-
1. Re: How to get process instance variables through jBPM Java Remote API
muthu8891 Apr 11, 2016 11:54 AM (in response to jizuzqui)Jamie,
Use the below code to retrieve the process instance variables as a Map<String,Object>. I have tested it, works fine!
ProcessInstance pi = ksession.getProcessInstance(processInstance.getId());
RuleFlowProcessInstance rfpi = (RuleFlowProcessInstance)pi;
Map<String,Object> variable = rfpi.getVariables();
System.out.println(variable);
-
2. Re: How to get process instance variables through jBPM Java Remote API
jizuzqui Apr 19, 2016 11:03 AM (in response to muthu8891)Muthu,
I don't find any RuleFlowProcessInstance class definition in kie-remote-client...
-
3. Re: How to get process instance variables through jBPM Java Remote API
muthu8891 Apr 25, 2016 3:28 AM (in response to jizuzqui)Try these 4 dependencies
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>6.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-internal</artifactId>
<version>6.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-flow</artifactId>
<version>6.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-test</artifactId>
<version>6.3.0.Final</version>
</dependency>
Code for the same
package com.sample;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.jbpm.ruleflow.instance.RuleFlowProcessInstance;
import org.jbpm.test.JbpmJUnitBaseTestCase;
import org.junit.Test;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.manager.RuntimeManager;
import org.kie.api.runtime.process.ProcessInstance;
/**
* This is a sample file to test a process.
*/
public class ProcessTest extends JbpmJUnitBaseTestCase {
@Test
public void testProcess() throws IOException {
RuntimeManager manager = createRuntimeManager("com/sample/sample.bpmn");
RuntimeEngine engine = getRuntimeEngine(null);
KieSession ksession = engine.getKieSession();
Map<String,Object> map = new HashMap<String, Object>();
map.put("input", "VALUE");
ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello",map);
System.out.println(processInstance.getId());
ProcessInstance pi = ksession.getProcessInstance(processInstance.getId());
RuleFlowProcessInstance rfpi = (RuleFlowProcessInstance)pi;
Map<String,Object> variable = rfpi.getVariables();
System.out.println(variable);
}
}
You can use the same dependencies along with remote client.