cancel
Showing results for 
Search instead for 
Did you mean: 

How to identify task type

masarrat
Champ in-the-making
Champ in-the-making
Hi,

I am having a scenario, where i have to execute bpmn flow programaticaly. For this i am fetching task from process, perform some operations and complete that task. Now i want to perform operations on the basis of task type. For example if current task is User task than i will operation A and if task type is service task i want to perform operation B.

But till now i am not able to find any class/method which will help to find type of task. Is there class or method available for this?


Thanks and Regards
Masarrat Siddiqui
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
You can use RepositoryServiceImpl for this:

public ReadOnlyProcessDefinition getDeployedProcessDefinition(String processDefinitionId) {
Use the PVMActivities (cast to ActivityImpl) and check the type to the getActivityBehaviour() return value.

OR even better, use the BPMN2.0 model for this, this has explicit ally typed objects for each type of task/activity. See https://github.com/Activiti/Activiti/tree/master/modules/activiti-bpmn-model and https://github.com/Activiti/Activiti/tree/master/modules/activiti-bpmn-converter