How to create an execution using spring boot ? How to get the ExecutionEntityManager in springboot

cancel
Showing results for 
Search instead for 
Did you mean: 
alexon_alex
Member II

How to create an execution using spring boot ? How to get the ExecutionEntityManager in springboot

1. A current task is allocated to multiple assignees. It should be possible to assign more people, once the task is active.

2. Current activiti version used is 6

3. CreatedExecution() method was supported in activiti 5. As per the activiti 5 to 6 migration guide, the this method is moved to ExecutionEntityManager. and can be accessed from Context

4. How to get the Context in spring boot ?

5. OR what is the possible option to add new executions run time to a task

4 Replies
bassam_al-saror
Alfresco Employee

Re: How to create an execution using spring boot ? How to get the ExecutionEntityManager in springboot

Can you give an example on how was that possible in version 5?

alexon_alex
Member II

Re: How to create an execution using spring boot ? How to get the ExecutionEntityManager in springboot

Thanks for your attention, 

In activiti 5 version, we can use

org.activiti.engine.impl.pvm.delegate.ActivityBehavior 

to create an execution

Activiti Migraton Guide : Activiti v5 to Activiti v6 | Activiti 

bassam_al-saror
Alfresco Employee

Re: How to create an execution using spring boot ? How to get the ExecutionEntityManager in springboot

Calling Context.getCommandContext().getExecutionEntityManager() doesn't work for you? It only works in an active context scope. You can use ManagementService (Activiti - Engine 6.0.0 API) to execute something in active context if your code doesn't run in an active context.

alexon_alex
Member II

Re: How to create an execution using spring boot ? How to get the ExecutionEntityManager in springboot

Thanks for your reply. I will try this case.

The use case for me is like - I have created a multi instance user task at one point of time in the BPMN flow. (The multi instance task is controlled by "noOfInstances" variable in BPMN). The requirement is to add new/delete existing assignees of this multi user task. Deletion of an assignee is much easy, as we just complete the task for that user. But add a new assignee and changing the "noOfInstance" variable was not possible (this is my issue).

The issues faced for getting the active context  

1) As per my understanding, active context can be obtained if a call back trigger to java happen from BPMN flow (means the task listener / execution listener). This is not possible for me, as i wont be sending any trigger to BPMN flow in my use case explained above

2) Get the active context from java with out any BPMN trigger ? Not sure this is possible or not, Also we are using the spring boot activiti startup dependency, so the engine/configurations are controlled by Spring