Package org.drools.runtime.process

Examples of org.drools.runtime.process.WorkItemHandler


    properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");
    KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
    StatefulKnowledgeSession session = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
        new JPAWorkingMemoryDbLogger(session);
        JPAProcessInstanceDbLog log = new JPAProcessInstanceDbLog(env);
        session.getWorkItemManager().registerWorkItemHandler("Human Task", new WorkItemHandler() {
      public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
        Map<String, Object> results = new HashMap<String, Object>();
        results.put("Result", "ResultValue");
        manager.completeWorkItem(workItem.getId(), results);
      }
View Full Code Here


    properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");
    KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
    StatefulKnowledgeSession session = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
        new JPAWorkingMemoryDbLogger(session);
        JPAProcessInstanceDbLog log = new JPAProcessInstanceDbLog(env);
        session.getWorkItemManager().registerWorkItemHandler("Human Task", new WorkItemHandler() {
      public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
        Map<String, Object> results = new HashMap<String, Object>();
        results.put("Result", "ResultValue");
        manager.completeWorkItem(workItem.getId(), results);
      }
View Full Code Here

        Package pkg = builder.getPackage();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        final List<String> myList = new ArrayList<String>();
        WorkingMemory workingMemory = ruleBase.newStatefulSession();
        workingMemory.getWorkItemManager().registerWorkItemHandler("Log", new WorkItemHandler() {
      public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
        String message = (String) workItem.getParameter("Message");
//        System.out.println(message);
        myList.add(message);
        manager.completeWorkItem(workItem.getId(), null);
View Full Code Here

        );
       
        ((AbstractRuleBase) ((InternalKnowledgeBase) kbase).getRuleBase()).addProcess(process);
       
        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        ksession.getWorkItemManager().registerWorkItemHandler("MyWork", new WorkItemHandler() {
      public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
        System.out.println("Executing work item");
        SubProcessTest.this.workItem = workItem;
      }
      public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
View Full Code Here

           
            final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
            kbuilder.add(ResourceFactory.newClassPathResource( "BPMN2-MultiThreadServiceProcess.bpmn" ), ResourceType.BPMN2 );
            KnowledgeBase kbase = kbuilder.newKnowledgeBase();
            StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
            ksession.getWorkItemManager().registerWorkItemHandler("Log", new WorkItemHandler() {
        public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
          Long threadId = (Long) workItem.getParameter("id");
//          System.out.println("Executing work item " + workItem.getId() + " for thread " + threadId);
          workItems.put(workItem.getId(), threadId);
        }
View Full Code Here

           
            final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
            kbuilder.add(ResourceFactory.newClassPathResource( "BPMN2-MultiThreadServiceProcess.bpmn" ), ResourceType.BPMN2 );
            KnowledgeBase kbase = kbuilder.newKnowledgeBase();
            StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
            ksession.getWorkItemManager().registerWorkItemHandler("Log", new WorkItemHandler() {
        public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
          Long threadId = (Long) workItem.getParameter("id");
//          System.out.println("Executing process instance " + workItem.getProcessInstanceId() + " for thread " + threadId);
          workItems.put(workItem.getProcessInstanceId(), threadId);
        }
View Full Code Here

  }
 
  public void testDataInputAssociations() throws Exception {
        KnowledgeBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-DataInputAssociations.bpmn2");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WorkItemHandler() {
            public void abortWorkItem(WorkItem manager, WorkItemManager mgr) {
               
            }
            public void executeWorkItem(WorkItem workItem, WorkItemManager mgr) {
                assertEquals("hello world", workItem.getParameter("coId"));
View Full Code Here

    }
 
  public void testDataInputAssociationsWithStringObject() throws Exception {
        KnowledgeBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-DataInputAssociations-string-object.bpmn2");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WorkItemHandler() {

            public void abortWorkItem(WorkItem manager, WorkItemManager mgr) {
               
            }
View Full Code Here

    }
 
  public void FIXMEtestDataInputAssociationsWithLazyLoading() throws Exception {
        KnowledgeBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-DataInputAssociations-lazy-creating.bpmn2");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WorkItemHandler() {

            public void abortWorkItem(WorkItem manager, WorkItemManager mgr) {
               
            }
View Full Code Here

    }
 
  public void FIXMEtestDataInputAssociationsWithString() throws Exception {
        KnowledgeBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-DataInputAssociations-string.bpmn2");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WorkItemHandler() {

            public void abortWorkItem(WorkItem manager, WorkItemManager mgr) {
               
            }
View Full Code Here

TOP

Related Classes of org.drools.runtime.process.WorkItemHandler

Copyright © 2018 www.massapicom. 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.