本文整理汇总了Java中org.activiti.engine.task.Task.getProcessDefinitionId方法的典型用法代码示例。如果您正苦于以下问题:Java Task.getProcessDefinitionId方法的具体用法?Java Task.getProcessDefinitionId怎么用?Java Task.getProcessDefinitionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.task.Task
的用法示例。
在下文中一共展示了Task.getProcessDefinitionId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TaskVo
import org.activiti.engine.task.Task; //导入方法依赖的package包/类
public TaskVo(Task task) {
this.id = task.getId();
this.name = task.getName();
this.title = task.getDescription();
this.priority = task.getPriority();
this.owner = task.getOwner();
this.assignee = task.getAssignee();
this.processInstanceId = task.getProcessInstanceId();
this.executionId = task.getExecutionId();
this.processDefinitionId = task.getProcessDefinitionId();
this.createTime = task.getCreateTime();
this.taskDefinitionKey = task.getTaskDefinitionKey();
this.dueDate = task.getDueDate();
this.category = task.getCategory();
this.parentTaskId = task.getParentTaskId();
this.tenantId = task.getTenantId();
this.formKey = task.getFormKey();
this.suspended = task.isSuspended();
}
示例2: localize
import org.activiti.engine.task.Task; //导入方法依赖的package包/类
protected void localize(Task task) {
task.setLocalizedName(null);
task.setLocalizedDescription(null);
if (locale != null) {
String processDefinitionId = task.getProcessDefinitionId();
if (processDefinitionId != null) {
ObjectNode languageNode = Context.getLocalizationElementProperties(locale, task.getTaskDefinitionKey(), processDefinitionId, withLocalizationFallback);
if (languageNode != null) {
JsonNode languageNameNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_NAME);
if (languageNameNode != null && !languageNameNode.isNull()) {
task.setLocalizedName(languageNameNode.asText());
}
JsonNode languageDescriptionNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_DESCRIPTION);
if (languageDescriptionNode != null && !languageDescriptionNode.isNull()) {
task.setLocalizedDescription(languageDescriptionNode.asText());
}
}
}
}
}
示例3: deleteAttachmentsByTaskId
import org.activiti.engine.task.Task; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void deleteAttachmentsByTaskId(String taskId) {
checkHistoryEnabled();
List<AttachmentEntity> attachments = getDbSqlSession().selectList("selectAttachmentsByTaskId", taskId);
boolean dispatchEvents = getProcessEngineConfiguration().getEventDispatcher().isEnabled();
String processInstanceId = null;
String processDefinitionId = null;
String executionId = null;
if (dispatchEvents && attachments != null && !attachments.isEmpty()) {
// Forced to fetch the task to get hold of the process definition for event-dispatching, if available
Task task = getTaskManager().findTaskById(taskId);
if (task != null) {
processDefinitionId = task.getProcessDefinitionId();
processInstanceId = task.getProcessInstanceId();
executionId = task.getExecutionId();
}
}
for (AttachmentEntity attachment : attachments) {
String contentId = attachment.getContentId();
if (contentId != null) {
getByteArrayManager().deleteByteArrayById(contentId);
}
getDbSqlSession().delete(attachment);
if (dispatchEvents) {
getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_DELETED, attachment, executionId, processInstanceId, processDefinitionId));
}
}
}
示例4: findTaskForm
import org.activiti.engine.task.Task; //导入方法依赖的package包/类
/**
* 获得任务表单,不包含表单内容.
*/
public FormDTO findTaskForm(String taskId) {
if (taskId == null) {
logger.error("taskId cannot be null");
return null;
}
Task task = processEngine.getTaskService().createTaskQuery()
.taskId(taskId).singleResult();
if (task == null) {
logger.error("cannot find task for {}", taskId);
return null;
}
String processDefinitionId = task.getProcessDefinitionId();
String activityId = task.getTaskDefinitionKey();
FormDTO formDto = new FormDTO();
formDto.setTaskId(taskId);
List<BpmConfOperation> bpmConfOperations = bpmConfOperationManager
.find("from BpmConfOperation where bpmConfNode.bpmConfBase.processDefinitionId=? and bpmConfNode.code=?",
processDefinitionId, activityId);
for (BpmConfOperation bpmConfOperation : bpmConfOperations) {
formDto.getButtons().add(bpmConfOperation.getValue());
}
formDto.setProcessDefinitionId(processDefinitionId);
formDto.setActivityId(activityId);
List<BpmConfForm> bpmConfForms = bpmConfFormManager
.find("from BpmConfForm where bpmConfNode.bpmConfBase.processDefinitionId=? and bpmConfNode.code=?",
processDefinitionId, activityId);
if (!bpmConfForms.isEmpty()) {
BpmConfForm bpmConfForm = bpmConfForms.get(0);
if (!Integer.valueOf(2).equals(bpmConfForm.getStatus())) {
// 外部表单
if (Integer.valueOf(1).equals(bpmConfForm.getType())) {
formDto.setRedirect(true);
formDto.setUrl(bpmConfForm.getValue());
} else {
formDto.setCode(bpmConfForm.getValue());
}
}
}
return formDto;
}