JBoss Community

How to get Process Instance Variables from Ksession.getProcessInstance(..) ?

created by Thomas Setiabudi in jBPM - View the full discussion

Hi,

 

How do we get variables of a Process Instance if we get the process instance from kssession?

 

In this discussion

https://community.jboss.org/message/753997

 

it says to get the variable instance this way

VariableScopeInstance variableScope = (VariableScopeInstance) processInstance.getContextInstance(VariableScope.VARIABLE_SCOPE);

                                        Map<String, Object> variables = variableScope.getVariables();

 

where processInstance is org.jbpm.process.instance.ProcessInstance

 

While this is what I do:

org.jbpm.process.instance.ProcessInstance processInstance = (org.jbpm.process.instance.ProcessInstance) ksession.getProcessInstance(processInstanceId);

 

 

ksession.getProcessInstance(..) returns org.drools.runtime.process.ProcessInstance

 

can I just convert it that way?

 

 

Regards,

Thomas Setiabudi

Reply to this message by going to Community

Start a new discussion in jBPM at Community