callActivity flowablw creatig another process instance

Hi everyone so i have recently started to use flowable and i have been getting an issue of when i work through callActivity that calls another process and when i finish the first task of that process it shows completed on process engine but also re creates another process instance of it

usertask->userTask->callActivity
callActivity(start->usertask->usertask->end

Hey @kartik,

What is the problem with that?

A Call Activity is a task in Flowable that is going to create a child process instance.

Cheers,
Filip

its like when it enters the callActivity it calls another process now when i am executing the first task of that process its executing the first task inside that process and moving to the next task But it also created another process instance of the same process with first task
Basically it goes back to the first task again

Thanks for replying

Are you by any chance referencing the same process in the Call Activity?

Can you please share your BPMN XMLs, so that we can help better?

Cheers,
Filip

hey
how do we like start executing the call activity process?

public List<TaskDetails> initiateFeasibility(String processInstanceId, Feasibility Feasibility){
        Map<String,Object> variables=new HashMap<>();
        variables.put("status", Feasibility.getstatus());
        ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
        //String newProcessInstanceId=(String) runtimeService.getVariables();
        System.out.println("Process Instance Id: " + processInstance.getProcessInstanceId());
        List<Task> taskList=taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).list();
        taskService.setVariables(taskList.get(0).getId(),variables);
        List<TaskDetails> taskDetailsList = new ArrayList<>();
        for (Task task : taskList){
            Map<String,Object> processVariable=taskService.getVariables(task.getId());
            taskDetailsList.add(new TaskDetails(task.getId(),task.getName(),processVariable));
        }
        taskService.complete(taskList.get(0).getId(),variables);
        return taskDetailsList;
    }

This is the task of a process which is called after the call activity process is called

Hey @kartik,

Sorry, but I don’t understand your last post. You shared some code, what should we do with this code?

Cheers,
Filip

hey,
I am like very new on flowable so ill take you through what i am actually facing
so basically theres a main process which has callActivity that of course has another process
now when i try to execute tasks in the process that was called by the callAcitvity it doesnt get executed or we can doesnt get completed and move to the new task

What i implemented was for the initial task that is the main task it generates a processInstanceId by startprocessBykey and then i went on to excute the task that are in the main process now when i tried to do the same process that is the above code you can see it doesnt work

That’s the part that I do not understand. What you are explaining should never be happenning.

Can you please share a full example with runnable Flowable and your BPMN XMLs that we can run on our own? Only with that we can help you out more. Without that, we can only be guessing and going in circles as it is not clear.

Cheers,
Filip

okay ill share what i wanted to know
ill just put it all together

hey i have a question
can the callActivity work with processInstance Id of the parent process?

cheers,
kartik