RuleBase ruleBase = readRule(false);
WorkingMemory workingMemory = ruleBase.newStatefulSession();
Map<String, Object> map = new HashMap<String, Object>();
map.put("x", "x-value");
org.jbpm.process.instance.ProcessInstance processInstance = ( org.jbpm.process.instance.ProcessInstance )
workingMemory.startProcess("com.sample.ruleflow", map);
assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
assertEquals(2, workingMemory.getProcessInstances().size());
for (ProcessInstance p: workingMemory.getProcessInstances()) {
VariableScopeInstance variableScopeInstance = (VariableScopeInstance)
(( org.jbpm.process.instance.ProcessInstance )p).getContextInstance(VariableScope.VARIABLE_SCOPE);