antmendoza
2013-07-11 16:32:44 UTC
antmendoza [https://community.jboss.org/people/antmendoza] created the discussion
"Re: How to get Process Instance Variables from Ksession.getProcessInstance(..) ?"
To view the discussion, visit: https://community.jboss.org/message/827594#827594
--------------------------------------------------------------
Hi Thomas,
I have tested https://community.jboss.org/message/753997 (https://community.jboss.org/message/753997#753997) and I hadn't any problem.
Before I know this solution, I used to cast processInstance to org.jbpm.workflow.instance.WorkflowProcessInstance.
         Map<String, Object> varMap = new HashMap<String, Object>();
         varMap.put("variable", "test");
         org.drools.runtime.process.ProcessInstance processInstance = ksession.createProcessInstance(
                           processId, varMap);
         org.jbpm.workflow.instance.WorkflowProcessInstance workflowProcessInstance = (org.jbpm.workflow.instance.WorkflowProcessInstance) processInstance;
         String varValue = (String) workflowProcessInstance.getVariable("variable");
         Assert.assertEquals("test", varValue);
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/827594#827594]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
"Re: How to get Process Instance Variables from Ksession.getProcessInstance(..) ?"
To view the discussion, visit: https://community.jboss.org/message/827594#827594
--------------------------------------------------------------
Hi Thomas,
I have tested https://community.jboss.org/message/753997 (https://community.jboss.org/message/753997#753997) and I hadn't any problem.
Before I know this solution, I used to cast processInstance to org.jbpm.workflow.instance.WorkflowProcessInstance.
         Map<String, Object> varMap = new HashMap<String, Object>();
         varMap.put("variable", "test");
         org.drools.runtime.process.ProcessInstance processInstance = ksession.createProcessInstance(
                           processId, varMap);
         org.jbpm.workflow.instance.WorkflowProcessInstance workflowProcessInstance = (org.jbpm.workflow.instance.WorkflowProcessInstance) processInstance;
         String varValue = (String) workflowProcessInstance.getVariable("variable");
         Assert.assertEquals("test", varValue);
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/827594#827594]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]