本文整理汇总了Java中org.activiti.engine.history.HistoricTaskInstance.getId方法的典型用法代码示例。如果您正苦于以下问题:Java HistoricTaskInstance.getId方法的具体用法?Java HistoricTaskInstance.getId怎么用?Java HistoricTaskInstance.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.history.HistoricTaskInstance
的用法示例。
在下文中一共展示了HistoricTaskInstance.getId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttachment
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
@GET
@Path("/{taskId}/attachments/{attachmentId}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getAttachment(@PathParam("taskId") String taskId,
@PathParam("attachmentId") String attachmentId) {
HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
TaskService taskService = BPMNOSGIService.getTaskService();
Attachment attachment = taskService.getAttachment(attachmentId);
if (attachment == null) {
throw new ActivitiObjectNotFoundException("Task '" + task.getId() + "' doesn't have an attachment with id '" + attachmentId + "'.", Comment.class);
}
return Response.ok().entity(new RestResponseFactory().createAttachmentResponse(attachment, uriInfo.getBaseUri
().toString())).build();
}
示例2: getComment
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
@GET
@Path("/{taskId}/comments/{commentId}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getComment(@PathParam("taskId") String taskId,
@PathParam("commentId") String commentId) {
HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
TaskService taskService = BPMNOSGIService.getTaskService();
Comment comment = taskService.getComment(commentId);
if (comment == null || !task.getId().equals(comment.getTaskId())) {
throw new ActivitiObjectNotFoundException("Task '" + task.getId() + "' doesn't have a comment with id '" + commentId + "'.", Comment.class);
}
return Response.ok().entity(new RestResponseFactory().createRestComment(comment, uriInfo.getBaseUri()
.toString())).build();
}
示例3: getEvent
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
@GET
@Path("/{taskId}/events/{eventId}")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getEvent(@PathParam("taskId") String taskId,
@PathParam("eventId") String eventId) {
HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
TaskService taskService = BPMNOSGIService.getTaskService();
Event event = taskService.getEvent(eventId);
if (event == null || !task.getId().equals(event.getTaskId())) {
throw new ActivitiObjectNotFoundException("Task '" + task.getId() + "' doesn't have an event with id '" + eventId + "'.", Event.class);
}
EventResponse eventResponse = new RestResponseFactory().createEventResponse(event, uriInfo.getBaseUri()
.toString());
return Response.ok().entity(eventResponse).build();
}
示例4: convert
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
public WorkflowTask convert(HistoricTaskInstance historicTaskInstance)
{
if(historicTaskInstance == null)
{
return null;
}
WorkflowPath path = getWorkflowPath(historicTaskInstance);
if(path == null)
{
// When path is null, workflow is deleted or cancelled. Task should
// not be used
return null;
}
// Extract node from historic task
WorkflowNode node = buildHistoricTaskWorkflowNode(historicTaskInstance);
WorkflowTaskState state= WorkflowTaskState.COMPLETED;
String taskId = historicTaskInstance.getId();
// Get the local task variables from the history
Map<String, Object> variables = propertyConverter.getHistoricTaskVariables(taskId);
Map<QName, Serializable> historicTaskProperties = propertyConverter.getTaskProperties(historicTaskInstance, variables);
// Get task definition from historic variable
String formKey = (String) variables.get(ActivitiConstants.PROP_TASK_FORM_KEY);
WorkflowTaskDefinition taskDef = factory.createTaskDefinition(formKey, node, formKey, false);
String title = historicTaskInstance.getName();
String description = historicTaskInstance.getDescription();
String taskName = taskDef.getId();
return factory.createTask(taskId, taskDef, taskName,
title, description, state, path, historicTaskProperties);
}
示例5: withdraw
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
/**
* 撤销.
*/
@RequestMapping("workspace-withdraw")
public String withdraw(
@RequestParam("processInstanceId") String processInstanceId) {
logger.debug("processInstanceId : {}", processInstanceId);
ProcessInstance processInstance = processEngine.getRuntimeService()
.createProcessInstanceQuery()
.processInstanceId(processInstanceId).singleResult();
String initiator = "";
String firstUserTaskActivityId = internalProcessConnector
.findFirstUserTaskActivityId(
processInstance.getProcessDefinitionId(), initiator);
logger.debug("firstUserTaskActivityId : {}", firstUserTaskActivityId);
List<HistoricTaskInstance> historicTaskInstances = processEngine
.getHistoryService().createHistoricTaskInstanceQuery()
.processInstanceId(processInstanceId)
.taskDefinitionKey(firstUserTaskActivityId).list();
HistoricTaskInstance historicTaskInstance = historicTaskInstances
.get(0);
String taskId = historicTaskInstance.getId();
HumanTaskDTO humanTaskDto = humanTaskConnector
.findHumanTaskByTaskId(taskId);
String comment = "";
humanTaskConnector.withdraw(humanTaskDto.getId(), comment);
return "redirect:/bpm/workspace-listRunningProcessInstances.do";
}
示例6: publishTaskDocument
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
@Override
public void publishTaskDocument(Map<String, Object> taskMap, HistoricTaskInstance taskInstanceDetails) throws JsonProcessingException {
String documentId = taskInstanceDetails.getProcessDefinitionId() + "-"
+ taskInstanceDetails.getProcessInstanceId() + "-" + taskInstanceDetails.getId();
String indexName = indexPrefix;
if (taskInstanceDetails.getStartTime() != null) {
indexName = indexName + '-' + new SimpleDateFormat("yyyy.MM").format(taskInstanceDetails.getStartTime());
}
elasticHTTPClient.execute(esUrl + indexName + "/bpmanalyticsevent/" + documentId,
objectMapper.writeValueAsString(taskMap), "PUT");
}
开发者ID:cijujoseph,项目名称:activiti-analytics-spring-boot,代码行数:14,代码来源:CustomElasticAnalyticsEndpoint.java
示例7: Task
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
public Task(HistoricTaskInstance taskInstance)
{
this.id = taskInstance.getId();
this.processId = taskInstance.getProcessInstanceId();
this.processDefinitionId = taskInstance.getProcessDefinitionId();
this.activityDefinitionId = taskInstance.getTaskDefinitionKey();
this.name = taskInstance.getName();
this.description = taskInstance.getDescription();
this.dueAt = taskInstance.getDueDate();
this.startedAt = taskInstance.getStartTime();
this.endedAt = taskInstance.getEndTime();
this.durationInMs = taskInstance.getDurationInMillis();
this.priority = taskInstance.getPriority();
this.owner = taskInstance.getOwner();
this.assignee = taskInstance.getAssignee();
this.formResourceKey = taskInstance.getFormKey();
if (taskInstance.getEndTime() != null)
{
this.state = TaskStateTransition.COMPLETED.name().toLowerCase();
}
else if (taskInstance.getAssignee() != null)
{
this.state = TaskStateTransition.CLAIMED.name().toLowerCase();
}
else
{
this.state = TaskStateTransition.UNCLAIMED.name().toLowerCase();
}
}
示例8: deleteCurrentTaskInstance
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
public Result deleteCurrentTaskInstance(String taskId, HistoricTaskInstance taskInstance) {
//删除正在执行的任务
//删除HistoricTaskInstance
String sql_task = "delete from " + managementService.getTableName(HistoricTaskInstance.class) + " where " +
"ID_='" + taskId + "' or ID_='" + taskInstance.getId() + "'";
this.executeSql(sql_task);
//删除HistoricActivityInstance
String sql_activity = "delete from " + managementService.getTableName(HistoricActivityInstance.class) + " where " +
"TASK_ID_='" + taskId + "' or TASK_ID_='" + taskInstance.getId() + "'";
this.executeSql(sql_activity);
//获取当前的任务,保存签收人
Task task = taskService.createTaskQuery().executionId(taskInstance.getExecutionId()).singleResult();
task.setAssignee(taskInstance.getAssignee());
task.setOwner(taskInstance.getOwner());
taskService.saveTask(task);
//解决HistoricActivityInstance的Assignee为空的现象
if (!StrUtil.isEmpty(taskInstance.getAssignee())) {
String sql_update = "update " + managementService.getTableName(HistoricActivityInstance.class) + " set " +
"ASSIGNEE_='" + taskInstance.getAssignee() + "' where TASK_ID_='" + task.getId() + "'";
this.executeSql(sql_update);
}
String sql_update_execution = "update " + managementService.getTableName(Execution.class) + " set " +
"ACT_ID_='" + taskInstance.getTaskDefinitionKey() + "' where ID_='" + taskInstance.getExecutionId() + "'";
this.executeSql(sql_update_execution);
return new Result(true);
}
示例9: HistoricTaskWrapper
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
public HistoricTaskWrapper(HistoricTaskInstance historicTaskInstance) {
this.id = historicTaskInstance.getId();
setName(historicTaskInstance.getName());
setDescription(historicTaskInstance.getDescription());
setDueDate(historicTaskInstance.getDueDate());
setPriority(historicTaskInstance.getPriority());
setOwner(historicTaskInstance.getOwner());
setAssignee(historicTaskInstance.getAssignee());
}
示例10: getAttachmentContent
import org.activiti.engine.history.HistoricTaskInstance; //导入方法依赖的package包/类
@GET
@Path("/{taskId}/attachments/{attachmentId}/content")
public Response getAttachmentContent(@PathParam("taskId") String taskId,
@PathParam("attachmentId") String attachmentId) {
TaskService taskService = BPMNOSGIService.getTaskService();
HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);
Attachment attachment = taskService.getAttachment(attachmentId);
if (attachment == null) {
throw new ActivitiObjectNotFoundException("Task '" + task.getId() + "' doesn't have an attachment with id '" + attachmentId + "'.", Attachment.class);
}
InputStream attachmentStream = taskService.getAttachmentContent(attachmentId);
if (attachmentStream == null) {
throw new ActivitiObjectNotFoundException("Attachment with id '" + attachmentId +
"' doesn't have content associated with it.", Attachment.class);
}
Response.ResponseBuilder responseBuilder = Response.ok();
String type = attachment.getType();
MediaType mediaType = MediaType.valueOf(type);
if (mediaType != null) {
responseBuilder.type(mediaType);
} else {
responseBuilder.type("application/octet-stream");
}
byte[] attachmentArray;
try {
attachmentArray = IOUtils.toByteArray(attachmentStream);
} catch (IOException e) {
throw new ActivitiException("Error creating attachment data", e);
}
String dispositionValue = "inline; filename=\"" + attachment.getName() + "\"";
responseBuilder.header("Content-Disposition", dispositionValue);
return responseBuilder.entity(attachmentArray).build();
}