本文整理了Java中org.activiti.engine.task.Task.getProcessDefinitionId()
方法的一些代码示例,展示了Task.getProcessDefinitionId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.getProcessDefinitionId()
方法的具体详情如下:
包路径:org.activiti.engine.task.Task
类名称:Task
方法名:getProcessDefinitionId
[英]Reference to the process definition or null if it is not related to a process.
[中]
代码示例来源:origin: Activiti/Activiti
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());
}
}
}
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public ActivityImpl selectActivityImplByTask(String taskId) {
if (StringUtils.isNullOrEmpty(taskId)) {
return new ActivityImpl(null, null);
}
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
ProcessDefinitionEntity entity = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(task.getProcessDefinitionId());
List<ActivityImpl> activities = entity.getActivities();
return activities
.stream()
.filter(activity -> "userTask".equals(activity.getProperty("type")) && activity.getProperty("name").equals(task.getName()))
.findFirst()
.orElseThrow(() -> new NotFoundException("获取节点信息失败"));
}
代码示例来源:origin: hs-web/hsweb-framework
.getNextActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), (execution));
.getActivityConfiguration(authentication.getUser().getId(), task.getProcessDefinitionId(), key)
.getCandidateInfo(task)
.stream())
代码示例来源:origin: hs-web/hsweb-framework
@Override
public void setCandidate(String doingUserId, Task task) {
if (task == null) {
return;
}
if (task.getTaskDefinitionKey() != null) {
//从配置中获取候选人
List<CandidateInfo> candidateInfoList = processConfigurationService
.getActivityConfiguration(doingUserId, task.getProcessDefinitionId(), task.getTaskDefinitionKey())
.getCandidateInfo(task);
if (CollectionUtils.isEmpty(candidateInfoList)) {
logger.warn("任务:{}未能设置候选人,此任务可能无法办理!", task);
} else {
for (CandidateInfo candidateInfo : candidateInfoList) {
Authentication user = candidateInfo.user();
if (user != null) {
taskService.addCandidateUser(task.getId(), user.getUser().getId());
}
}
}
} else {
logger.warn("未能成功设置环节候选人,task:{}", task);
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public void saveTaskForm(ProcessInstance instance, Task task, SaveFormRequest request) {
request.tryValidate();
ActivityConfigEntity entity = activityConfigService.selectByProcessDefineIdAndActivityId(task.getProcessDefinitionId(), task.getTaskDefinitionKey());
if (entity == null || StringUtils.isEmpty(entity.getFormId())) {
return;
}
Map<String, Object> formData = request.getFormData();
acceptStartProcessFormData(instance, formData);
acceptTaskFormData(task, formData);
dynamicFormOperationService.saveOrUpdate(entity.getFormId(), formData);
}
代码示例来源:origin: hs-web/hsweb-framework
.getDeployedProcessDefinition(task.getProcessDefinitionId());
代码示例来源:origin: hs-web/hsweb-framework
.getDeployedProcessDefinition(curTask.getProcessDefinitionId());
代码示例来源:origin: Activiti/Activiti
processDefinitionId = task.getProcessDefinitionId();
processInstanceId = task.getProcessInstanceId();
executionId = task.getExecutionId();
代码示例来源:origin: Activiti/Activiti
public Task from(org.activiti.engine.task.Task internalTask,
Task.TaskStatus status) {
TaskImpl task = new TaskImpl(internalTask.getId(),
internalTask.getName(),
status);
task.setProcessDefinitionId(internalTask.getProcessDefinitionId());
task.setProcessInstanceId(internalTask.getProcessInstanceId());
task.setAssignee(internalTask.getAssignee());
task.setClaimedDate(internalTask.getClaimTime());
task.setCreatedDate(internalTask.getCreateTime());
task.setDueDate(internalTask.getDueDate());
task.setDescription(internalTask.getDescription());
task.setOwner(internalTask.getOwner());
task.setParentTaskId(internalTask.getParentTaskId());
task.setPriority(internalTask.getPriority());
task.setFormKey(internalTask.getFormKey());
return task;
}
代码示例来源:origin: Activiti/Activiti
event.setProcessInstanceId(((Task) persistedObject).getProcessInstanceId());
event.setExecutionId(((Task) persistedObject).getExecutionId());
event.setProcessDefinitionId(((Task) persistedObject).getProcessDefinitionId());
} else if (persistedObject instanceof ProcessDefinition) {
event.setProcessDefinitionId(((ProcessDefinition) persistedObject).getId());
代码示例来源:origin: bill1012/AdminEAP
String formKey = formService.getTaskFormKey(task.getProcessDefinitionId(), task.getTaskDefinitionKey());
if (StrUtil.isEmpty(formUrl) && !StrUtil.isEmpty(formKey) && !formKey.endsWith(".form")) {
formUrl = formKey;
代码示例来源:origin: bill1012/AdminEAP
public Result submitTask(String taskId, Map<String, String> formData) {
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
String formKey = formService.getTaskFormKey(task.getProcessDefinitionId(), task.getTaskDefinitionKey());
Object renderForm = null;
if (!StrUtil.isEmpty(formKey) && formKey.endsWith(".form"))
代码示例来源:origin: org.flowable/flowable5-compatibility
@Override
public String getProcessDefinitionId() {
return activiti5Task.getProcessDefinitionId();
}
代码示例来源:origin: org.hswebframework.web/hsweb-system-workflow-local
@Override
public ActivityImpl selectActivityImplByTask(String taskId) {
if (StringUtils.isNullOrEmpty(taskId)) {
return new ActivityImpl(null, null);
}
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
ProcessDefinitionEntity entity = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(task.getProcessDefinitionId());
List<ActivityImpl> activities = entity.getActivities();
return activities
.stream()
.filter(activity -> "userTask".equals(activity.getProperty("type")) && activity.getProperty("name").equals(task.getName()))
.findFirst()
.orElseThrow(() -> new NotFoundException("获取节点信息失败"));
}
代码示例来源:origin: org.alfresco/alfresco-repository
public String apply(Task task)
{
//TODO This probably isn't very performant!
String defId = task.getProcessDefinitionId();
ProcessDefinition definition = repoService.createProcessDefinitionQuery().processDefinitionId(defId)
.singleResult();
return definition.getKey();
}
});
代码示例来源:origin: Alfresco/alfresco-repository
public String apply(Task task)
{
//TODO This probably isn't very performant!
String defId = task.getProcessDefinitionId();
ProcessDefinition definition = repoService.createProcessDefinitionQuery().processDefinitionId(defId)
.singleResult();
return definition.getKey();
}
});
代码示例来源:origin: org.hswebframework.web/hsweb-system-workflow-local
@Override
public void saveTaskForm(ProcessInstance instance, Task task, SaveFormRequest request) {
request.tryValidate();
ActivityConfigEntity entity = activityConfigService.selectByProcessDefineIdAndActivityId(task.getProcessDefinitionId(), task.getTaskDefinitionKey());
if (entity == null || StringUtils.isEmpty(entity.getFormId())) {
return;
}
Map<String, Object> formData = request.getFormData();
acceptStartProcessFormData(instance, formData);
acceptTaskFormData(task, formData);
dynamicFormOperationService.saveOrUpdate(entity.getFormId(), formData);
}
代码示例来源:origin: org.alfresco/alfresco-repository
public WorkflowTaskDefinition getTaskDefinition(Task task)
{
// Get the task-form used (retrieved from cached process-definition)
TaskFormData taskFormData = formService.getTaskFormData(task.getId());
String taskDefId = null;
if(taskFormData != null)
{
taskDefId = taskFormData.getFormKey();
}
// Fetch node based on cached process-definition
ReadOnlyProcessDefinition procDef = activitiUtil.getDeployedProcessDefinition(task.getProcessDefinitionId());
WorkflowNode node = convert(procDef.findActivity(task.getTaskDefinitionKey()), true);
return factory.createTaskDefinition(taskDefId, node, taskDefId, false);
}
代码示例来源:origin: Alfresco/alfresco-repository
public WorkflowTaskDefinition getTaskDefinition(Task task)
{
// Get the task-form used (retrieved from cached process-definition)
TaskFormData taskFormData = formService.getTaskFormData(task.getId());
String taskDefId = null;
if(taskFormData != null)
{
taskDefId = taskFormData.getFormKey();
}
// Fetch node based on cached process-definition
ReadOnlyProcessDefinition procDef = activitiUtil.getDeployedProcessDefinition(task.getProcessDefinitionId());
WorkflowNode node = convert(procDef.findActivity(task.getTaskDefinitionKey()), true);
return factory.createTaskDefinition(taskDefId, node, taskDefId, false);
}
代码示例来源:origin: com.quhaodian.discover/discover-workflow
@Override
public TaskVo conver(Task task) {
TaskVo result = new TaskVo();
result.setCatalog(task.getCategory());
result.setId(task.getId());
result.setProcessDefinitionId(task.getProcessDefinitionId());
result.setName(task.getName());
result.setFlowName("" + taskService.getVariable(task.getId(), "name"));
result.setUpdateUrl("" + taskService.getVariable(task.getId(), "updateurl"));
result.setOid("" + taskService.getVariable(task.getId(), "oid"));
result.setAddDate(DateFormat.format(task.getCreateTime()));
return result;
}
}
内容来源于网络,如有侵权,请联系作者删除!