-
Enhancement
-
Resolution: Unresolved
-
Major
-
jBPM 6.0.0.Final
Because users often use rule tasks that involve the process instance itself, there are often constructions like this:
Map<String, ResourceType> resources = new HashMap<String, ResourceType>(); resources.put("RuleTask.bpmn2", ResourceType.BPMN2); resources.put("RuleTask.drl", ResourceType.DRL); // create RuntimeManager and RuntimeEngine RuntimeEngine runtimeEngine = getRuntimeEngine(); KieSession ksession = runtimeEngine.getKieSession(); Person person = new Person("guest", "Dluhoslav Chudobny"); person.setAge(25); // >= 18 Request request = new Request("1"); request.setPersonId("guest"); request.setAmount(500); // < 1000 ksession.insert(person); // insert fact and start process ksession.insert(request); ProcessInstance pi = ksession.startProcess("com.my.RuleTask"); // insert process instance ksession.insert((WorkflowProcessInstance) pi); ksession.fireAllRules(); // retrieve value assertEquals("Poor customer", ((Request)ksession.getObject(factHandle)).getInvalidReason());
The issue here is that this line:
ksession.insert((WorkflowProcessInstance) pi)
isn't currently possible via the remote API.
This issue is for the following improvements:
- create functionality to insert the process instance in the ksession via the remote API
Optionally:
- create functionality to retrieve a FactHandle via the remote API