cancel
Showing results for 
Search instead for 
Did you mean: 

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

mhmtgk
Champ on-the-rise
Champ on-the-rise

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 ACCEPTED ANSWER

mhmtgk
Champ on-the-rise
Champ on-the-rise

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 answer in original post

1 REPLY 1

mhmtgk
Champ on-the-rise
Champ on-the-rise

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.