2 Replies Latest reply on Apr 1, 2014 10:15 AM by Joey Teo

    JBPM6 ksession.signalEvent(String,Object,long) does not Signal Workflow to continue

    Joey Teo Newbie

      I'm having a problem with a workflow awaiting a Signal Continue process.

       

      I'm currently using the following code as the subject.

       

      ksession.signalEvent(String, Object, long)

      with String being the "signal event", Object being the data to signal in and Long being the process Instance Id. the processInstanceId is obtained from ksession.getId() which is the externalId of the process provided by ksession.

       

      it doesn't seem to signal the correct workflow instance process.

       

      however if I use the following

      ksession.signalEvent(String, Object)

      it works but ALL process instance workflows gets triggered which is not desired because there are alot of workflows process in the system.

       

      some help please.

       

      Environment.

      Jbpm 6.0.0 Final installed from ant install.demo

      jboss7.1.1

      Operating system Ubuntu 13.10

      Persistence as per jbpm-console persistence.xml and is working

       

      Session created with the following code

       

       

      EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.domain" );

      Environment env = KnowledgeBaseFactory.newEnvironment();

      env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );

      KieServices ks = KieServices.Factory.get();

      KieContainer kContainer = ks.newKieContainer(ks.newReleaseId("group", "artifact", "1.0.0"));

      org.kie.api.KieBase kbase = kContainer.newKieSession("defaultKieSession").getKieBase();

      StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase , null, env ); //for persistence..

      JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);

       

      Signal event as per jbpm6 examples on BPMN process creation.