hi all,
In flowable i have task as
ParentProcess
start->user1->user2->callActivity
SubProcess(call Activity)
start->user1-user2->end
Now lets say i complete the user1 and user2 task and move to the callActivity This is possible
but its also making another process Instance Id as
user1 task completed
user2 task not completed
Why is that happening?
My backend code is
public class FlowableService {
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@Autowired
private RepositoryService repositoryService;
@Autowired
private SubProcessBusinessKeyGenerator subProcessBusinessKeyGenerator;
public void startprocess(String orderId){
Map<String,Object> variables=new HashMap<>();
variables.put("businessKey",orderId);
ProcessDefinition processDefinition=repositoryService.createProcessDefinitionQuery().processDefinitionKey("startprocess").singleResult();
ProcessInstance instance=runtimeService.startProcessInstanceById(processDefinition.getId(),orderId,variables);
System.out.println("The process Instance Id "+Instance.getProcessInstanceId());
}
public List<WorkflowTask> getTask(String orderId, Map<String,Object> variables){
List<WorkflowTask> task=taskService.createTaskQuery().processInstanceId(getProcessInstanceId()).list();
taskService.setVariables(task.get(0).getId(),variables);
return task;
}
public void completeTask(String taskId){
taskService.complete(taskId);
}
}
As you can see it has created the process Instance when i have already completed all the task and moved to the callActivity
Please do tell me what are the reasom why it creates another processInstamces