Package org.drools.process.instance

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


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


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

        if (workItem != null) {
            ProcessInstance processInstance = ( ProcessInstance ) workingMemory.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));
            workingMemory.fireAllRules();
        }
    }
View Full Code Here

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

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

        if (workItem != null) {
            ProcessInstance processInstance = ( ProcessInstance ) workingMemory.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));
            workingMemory.fireAllRules();
        }
    }
View Full Code Here

        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)
        ((ProcessInstance) processInstance).getContextInstance(
        VariableScope.VARIABLE_SCOPE)).getVariable("MyVar"));
    }
View Full Code Here

        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)
        ((ProcessInstance) processInstance).getContextInstance(
        VariableScope.VARIABLE_SCOPE)).getVariable("MyVar"));
    }
View Full Code Here

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

            WorkItem workItem = (WorkItemImpl) workItemInfo.getWorkItem(env);
            ProcessInstance processInstance = workingMemory.getProcessInstance(workItem.getProcessInstanceId());
            workItem.setState(WorkItem.ABORTED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemAborted", workItem);
            }
            em.remove(workItemInfo);
            if (workItems != null) {
              workItems.remove(workItem.getId());
            }
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.