Examples of signalEvent()


Examples of org.drools.runtime.StatefulKnowledgeSession.signalEvent()

        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler());
        ProcessInstance processInstance = ksession.startProcess("IntermediateCatchEvent");
        assertTrue(processInstance.getState() == ProcessInstance.STATE_ACTIVE);
        ksession = restoreSession(ksession, true);
        // now signal process instance
        ksession.signalEvent("Message-HelloMessage", "SomeValue", processInstance.getId());
    assertProcessInstanceCompleted(processInstance.getId(), ksession);
    }

    public void testIntermediateCatchEventTimerDuration() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-IntermediateCatchEventTimerDuration.bpmn2");
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.signalEvent()

    ksession.addEventListener(new DefaultProcessEventListener() {
      public void afterProcessStarted(ProcessStartedEvent event) {
        list.add(event.getProcessInstance().getId());
      }
    });
        ksession.signalEvent("MyStartSignal", "NewValue");
    assertEquals(1, list.size());
    }
   
    public void testSignalStartDynamic() throws Exception {
      KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.signalEvent()

    ksession.addEventListener(new DefaultProcessEventListener() {
      public void afterProcessStarted(ProcessStartedEvent event) {
        list.add(event.getProcessInstance().getId());
      }
    });
        ksession.signalEvent("MyStartSignal", "NewValue");
    assertEquals(1, list.size());
    }
   
    public void testSignalEnd() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-SignalEndEvent.bpmn2");
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.signalEvent()

    }
   
    public void testMessageStart() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-MessageStart.bpmn2");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.signalEvent("Message-HelloMessage", "NewValue");
    }
   
    public void testMessageEnd() throws Exception {
        KnowledgeBase kbase = createKnowledgeBase("BPMN2-MessageEndEvent.bpmn2");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.signalEvent()

        Assert.assertEquals( ProcessInstance.STATE_ACTIVE,
                             processInstance.getState() );

        crmPersistentSession = createSession(kbase);

        crmPersistentSession.signalEvent( eventType,
                              null );
        processInstance = (RuleFlowProcessInstance) crmPersistentSession.getProcessInstance( processInstanceId );

        Assert.assertNull( processInstance );
    }
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance.signalEvent()

        ProcessInstance processInstance = session.startProcess("org.drools.event");
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
       
        session = SerializationHelper.getSerialisedStatefulSession(session);
        processInstance = session.getProcessInstance(processInstance.getId());
        processInstance.signalEvent("MyEvent", "MyValue");
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
        assertEquals("MyValue", ((VariableScopeInstance)
        ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
        VariableScope.VARIABLE_SCOPE)).getVariable("MyVar"));
    }
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance.signalEvent()

        ProcessInstance processInstance = session.startProcess("org.drools.event");
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());

        session = SerializationHelper.getSerialisedStatefulSession(session);
        processInstance = session.getProcessInstance(processInstance.getId());
        processInstance.signalEvent("MyEvent", "MyValue");
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
        assertEquals("MyValue", ((VariableScopeInstance)
        ((org.jbpm.process.instance.ProcessInstance) processInstance).getContextInstance(
        VariableScope.VARIABLE_SCOPE)).getVariable("MyVar"));
    }
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance.signalEvent()

    }
   
    public void execute(InternalWorkingMemory workingMemory) {
      ProcessInstance processInstance = workingMemory.getProcessInstance(processInstanceId);
      if (processInstance != null) {
        processInstance.signalEvent(type, event);
      }
    }

    public void execute(InternalKnowledgeRuntime kruntime) {
      ProcessInstance processInstance = kruntime.getProcessInstance(processInstanceId);
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance.signalEvent()

    }

    public void execute(InternalKnowledgeRuntime kruntime) {
      ProcessInstance processInstance = kruntime.getProcessInstance(processInstanceId);
      if (processInstance != null) {
        processInstance.signalEvent(type, event);
      }
    }

    public void write(MarshallerWriteContext context) throws IOException {
      context.writeInt( WorkingMemoryAction.SignalProcessInstanceAction );
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance.signalEvent()

       
        ProcessInstance processInstance = ksession.startProcess("org.drools.process.event");
        assertEquals(0, myList.size());
        Person jack = new Person();
        jack.setName("Jack");
        processInstance.signalEvent("myEvent", jack);
        assertEquals(1, myList.size());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
    }
   
    public void testEvent2() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.