cancel
Showing results for 
Search instead for 
Did you mean: 

Get Information of a UserTask which is not created yet.

mf
Confirmed Champ
Confirmed Champ
When my process is in a UserTask A, i need to get Information (form properties, and assignment expressions) of a UserTask B which is not crated (reached) yet (I have processDefinitionId and userTaskDefinitionKey of B). No expression evaluation is necessary.
Is it possible? how?

Thanks in advance
4 REPLIES 4

balsarori
Champ on-the-rise
Champ on-the-rise
I am afraid that this is not possible through the current API. However, its possible by using internal implementation classes (which may change in the future)

[java]
ProcessDefinitionEntity processDefinitionEntity = (ProcessDefinitionEntity) repositoryService.getProcessDefinition(processDefinitionId);
TaskDefinition taskDefinition = processDefinitionEntity.getTaskDefinitions().get(userTaskDefinitionKey);
[/java]

Check ProcessDefinitionEntity class
https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/...

mf
Confirmed Champ
Confirmed Champ
Thanks for quick response,

How can i get form-properties (TaskFormData) from a TaskDefinition? It has a TaskFormHandler field which needs TaskEntity for creating TaskFormData.

<code>
public interface TaskFormHandler extends FormHandler {

  TaskFormData createTaskForm(TaskEntity task);
 
  Expression getFormKey();
}
</code>

balsarori
Champ on-the-rise
Champ on-the-rise
Try using the UserTask BPMN model which you can get as follows:

[java]
UserTask userTask = (UserTask) repository.getBpmnModel(processDefinitionId).getFlowElement(userTaskDefinitionKey);
[/java]

https://github.com/Activiti/Activiti/blob/master/modules/activiti-bpmn-model/src/main/java/org/activ...

mf
Confirmed Champ
Confirmed Champ
Thanks, It works