Package org.drools.runtime.process

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


        ((AbstractRuleBase) ((InternalKnowledgeBase) kbase).getRuleBase()).addProcess(process);
        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();       
       
        ProcessInstance processInstance = ksession.startProcess("org.drools.process.event");
        assertEquals(0, myList.size());
        processInstance.signalEvent("myEvent", null);
        assertEquals(2, myList.size());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
    }
   
    public void testEvent5() {
View Full Code Here


       
        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());
    }
   
}
View Full Code Here

            (workItem).setResults(results);
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            (workItem).setState(WorkItem.COMPLETED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemCompleted", workItem);
            }
            workItems.remove(new Long(id));
        }
    }
View Full Code Here

        if (workItem != null) {
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.ABORTED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemAborted", workItem);
            }
            workItems.remove(new Long(id));
        }
    }
View Full Code Here

        if (processInstanceId == -1) {
            ksession.signalEvent(eventType, event);
        } else {
            ProcessInstance processInstance = ksession.getProcessInstance(processInstanceId);
            if (processInstance != null) {
                processInstance.signalEvent(eventType, event);
            }
        }
        return null;
    }
View Full Code Here

    if (processInstanceId == -1) {
        ksession.signalEvent(eventType, event);
    } else {
      ProcessInstance processInstance = ksession.getProcessInstance(processInstanceId);
      if (processInstance != null) {
        processInstance.signalEvent(eventType, event);
      }
    }
    return null;
  }
View Full Code Here

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

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

            ProcessInstance processInstance =
                kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.COMPLETED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemCompleted", workItem);
            }
            GrailsIntegration.getGormDomainService().deleteDomain(workItemInfo);
            if (workItems != null) {
                this.workItems.remove(workItem.getId());
            }
View Full Code Here

            WorkItem workItem = (WorkItemImpl) workItemInfo.getWorkItem(env);
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.ABORTED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemAborted", workItem);
            }
            GrailsIntegration.getGormDomainService().deleteDomain(workItemInfo);
            if (workItems != null) {
                workItems.remove(workItem.getId());
            }
View Full Code Here

            (workItem).setResults(results);
            ProcessInstance processInstance = kruntime.getProcessInstance(workItem.getProcessInstanceId());
            (workItem).setState(WorkItem.COMPLETED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemCompleted", workItem);
            }
            workItems.remove(new Long(id));
        }
    }
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.