07-10-2017 12:13 PM
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("flag", 1);
runtimeService.startProcessInstanceByKey(processDefinitionKey, variables);
// how to get all the list of tasks to be executed here
// if flag is 1, I will get task list(task1, task2, task4)
// if flag is 0, I will get task list(task1, task3)
07-11-2017 04:54 AM
Seems like what you're looking to do is to find the process definition and then traverse it to find what follows the gateway on each of its outgoing branches. There are examples in the Activiti codebase for finding a process definition (Activiti/DelegateHelper.java at master · Activiti/Activiti · GitHub ) and for traversing it (Activiti/BpmnJsonConverter.java at master · Activiti/Activiti · GitHub ). Part of what you'll presumably want to do is to locate the exclusive gateway (Activiti/ExclusiveGatewayValidator.java at master · Activiti/Activiti · GitHub ). In your case you'll want to get the definition through the either the RepositoryService or the RuntimeService.
07-18-2017 05:46 AM
I notice master has moved a bit but the code I referred to is still there if you search for getProcess and BpmnModel. Though perhaps a better place to look is Activiti/SubProcessWithExtensionsConverterTest.java at 6.0-release · Activiti/Activiti · GitHub
04-24-2019 06:33 PM
Ryan Dawson, i could not find in the test cases, and i have similar ask.please let me know for the right testcase
Explore our Alfresco products with the links below. Use labels to filter content by product module.