As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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)
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)
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.
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
Ryan Dawson, i could not find in the test cases, and i have similar ask.please let me know for the right testcase