Commit a Transaction in Activiti JAVA Delegate Service task

cancel
Showing results for 
Search instead for 
Did you mean: 
dilip_chenani
Customer

Commit a Transaction in Activiti JAVA Delegate Service task

I am working on solution for

1) calling a new Child Process fromn within a Service task of Parent Process.

2) submiting the task form of Child process from  same Service task of Parent Process.

Problem i am facing is Child process is not getting commited in database but process instance id is generated in-memory. Therefore, while submiting the task form of child process, error is thrown saying "could not find process with id xxxx". 

Is there a way to manually/forcefully commit the transaction and can be implemented inside the code logic of javadelegate service task? 

 

So the code will look like : 

public class ExecuteBusinessProcessDelegate implements JavaDelegate{
protected Expression processdeploymentid;//Required field

@Override
	public void execute(DelegateExecution execution) throws Exception {
String deploymentid = expConvUtility.getExpressionAsString(processdeploymentid, execution);
RuntimeService runtimeService = execution.getEngineServices().getRuntimeService();
		ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId,variables);

/// Commit the transaction here >>>>>

/// Submit the task ID here
}
}
2 Replies
EddieMay
Alfresco Employee

Re: Commit a Transaction in Activiti JAVA Delegate Service task

Hi @dilip_chenani 

As a customer, have you raised a ticket for this issue?

Cheers,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
dilip_chenani
Customer

Re: Commit a Transaction in Activiti JAVA Delegate Service task

Yes. My motive to post this query here was to get help from some community member if anyboday has already faced such issue. Thanks.