Is there any way to pass transient variable to inner call activity process

cancel
Showing results for 
Search instead for 
Did you mean: 
mhmtgk
Active Member

Is there any way to pass transient variable to inner call activity process

Jump to solution

Hi All,

That is a simple question. I want to use transient variable in sub call activity process. When I try to pass through input parameters, the error appears (as expected because it is not a process var) ; 

org.activiti.engine.ActivitiException: couldn't find a variable type that is able to serialize ...

1 Solution

Accepted Solutions
mhmtgk
Active Member

Re: Is there any way to pass transient variable to inner call activity process

Jump to solution

By the way I have resolved this issue by debugging engine.

First I have tried to reach root process instance with;

ExecutionEntity thisEntity = (ExecutionEntity) execution;

ExecutionEntity pi= (ExecutionEntityImpl) thisEntity.getRootProcessInstance()

But getRootProcessInstance() method returns null within call activity process. While getRootProcessInstanceId() returns the exact root process instance ID. I take a look at getRootProcessInstance() method. It calls a function;

--> ExecutionEntityImpl.java

protected void ensureRootProcessInstanceInitialized() {
if (rootProcessInstanceId == null) {
rootProcessInstance = (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findById(rootProcessInstanceId);
}
}

I think this code should be;

if (rootProcessInstanceId != null)

Because I can reach root process instance in a Service Task (JavaDelegate class) by;

ExecutionEntity thisEntity = (ExecutionEntity) execution;
ExecutionEntity pi= (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findById(thisEntity.getRootProcessInstanceId());

So this weekend passed by thinking this issue Smiley Happy

 

Best.

View solution in original post

1 Reply
mhmtgk
Active Member

Re: Is there any way to pass transient variable to inner call activity process

Jump to solution

By the way I have resolved this issue by debugging engine.

First I have tried to reach root process instance with;

ExecutionEntity thisEntity = (ExecutionEntity) execution;

ExecutionEntity pi= (ExecutionEntityImpl) thisEntity.getRootProcessInstance()

But getRootProcessInstance() method returns null within call activity process. While getRootProcessInstanceId() returns the exact root process instance ID. I take a look at getRootProcessInstance() method. It calls a function;

--> ExecutionEntityImpl.java

protected void ensureRootProcessInstanceInitialized() {
if (rootProcessInstanceId == null) {
rootProcessInstance = (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findById(rootProcessInstanceId);
}
}

I think this code should be;

if (rootProcessInstanceId != null)

Because I can reach root process instance in a Service Task (JavaDelegate class) by;

ExecutionEntity thisEntity = (ExecutionEntity) execution;
ExecutionEntity pi= (ExecutionEntityImpl) Context.getCommandContext().getExecutionEntityManager().findById(thisEntity.getRootProcessInstanceId());

So this weekend passed by thinking this issue Smiley Happy

 

Best.