Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-4209

Allow users to insert a ProcessInstance into the KieSession via the remote API

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • FUTURE
    • jBPM 6.0.0.Final
    • Remote Services

      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

              marco.rietveld Marco Rietveld (Inactive)
              marco.rietveld Marco Rietveld (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: