Package org.jbpm.process.instance.impl.demo

Examples of org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler


  }

  public void testMultiInstanceLoopCharacteristicsTask() throws Exception {
    KnowledgeBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-MultiInstanceLoopCharacteristicsTask.bpmn2");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
    ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());
    Map<String, Object> params = new HashMap<String, Object>();
    List<String> myList = new ArrayList<String>();
    myList.add("First Item");
    myList.add("Second Item");
    params.put("list", myList);
View Full Code Here


  }

  public void testOnEntryExitScript() throws Exception {
    KnowledgeBase kbase = createKnowledgeBase("BPMN2-OnEntryExitScriptProcess.bpmn2");
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
    ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new SystemOutWorkItemHandler());
    List<String> myList = new ArrayList<String>();
    ksession.setGlobal("list", myList);
    ProcessInstance processInstance = ksession.startProcess("OnEntryExitScriptProcess");
    assertTrue(processInstance.getState() == ProcessInstance.STATE_COMPLETED);
    assertEquals(4, myList.size());
View Full Code Here

                 emf );

        env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );

        StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
        ksession.getWorkItemManager().registerWorkItemHandler("MyWork", new SystemOutWorkItemHandler());
        ProcessInstance processInstance = ksession.startProcess( "org.drools.test.TestProcess" );
        ksession.insert( "TestString" );
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
    }
View Full Code Here

        runtimeManager = getRuntimeManager("bpmn/EvaluationProcess.bpmn2");
        runtimeEngine = runtimeManager.getRuntimeEngine(EmptyContext.get());
        ksession = runtimeEngine.getKieSession();

        logger.info("Register tasks");
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());
        ksession.getWorkItemManager().registerWorkItemHandler("RegisterRequest", new SystemOutWorkItemHandler());
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("employee", "UserId-12345");

        logger.info("Start process EvaluationProcess.bpmn2");
        ProcessInstance processInstance = ksession.startProcess("Evaluation", params);
View Full Code Here

            KieServices.Factory.get().getResources().newClassPathResource(
            "Evaluation.bpmn",getClass().getClassLoader()), ResourceType.BPMN2)
            .get();
        RuntimeManager runtimeManager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);
        KieSession ksession = runtimeManager.getRuntimeEngine(EmptyContext.get()).getKieSession();
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());

        LOG.info("Start process Evaluation (bpmn2)");
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("employee", "krisv");
    params.put("reason", "Yearly performance evaluation");
View Full Code Here

    public void testSimpleSession() throws Exception {
        Object obj = container.getComponentInstance("simpleSession");
        assertNotNull(obj);
        assertTrue(obj instanceof KieSession);
        KieSession ksession = (KieSession)obj;
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());
        ksession.getWorkItemManager().registerWorkItemHandler("RegisterRequest", new SystemOutWorkItemHandler());
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("employee", "UserId-12345");

        ksession.startProcess("Evaluation", params);
    }
View Full Code Here

                      ResourceType.DRF );
        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );

        StatefulKnowledgeSession ksession = InfinispanKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
        ksession.getWorkItemManager().registerWorkItemHandler("MyWork", new SystemOutWorkItemHandler());
        ProcessInstance processInstance = ksession.startProcess( "org.drools.test.TestProcess" );
        ksession.insert( "TestString" );
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
    }
View Full Code Here

      humanTaskHandler.setLocal(true);
      humanTaskHandler.connect();
      ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);
 
    // register other work items
    ksession.getWorkItemManager().registerWorkItemHandler("Log", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler());

    params = new HashMap<String, Object>();
    // initialize process parameters.
    params.put("employee", "erics");
    params.put("reason", "Amazing demos for JBoss World!");
View Full Code Here

       // setup task client to use running BRMS server task client.
       CommandBasedHornetQWSHumanTaskHandler handler = new CommandBasedHornetQWSHumanTaskHandler(ksession);
       handler.setClient(client);
       // register work items.
       ksession.getWorkItemManager().registerWorkItemHandler("Log", new SystemOutWorkItemHandler());
       ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler());
       ksession.getWorkItemManager().registerWorkItemHandler("Human Task", handler);
        
         // setup our input request for processing.
       final Map<String, Object> params = new HashMap<String, Object>();
       params.put("employee", "erics");
View Full Code Here

      humanTaskHandler.setLocal(true);
      humanTaskHandler.connect();
      ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);
 
    // register other work items
    ksession.getWorkItemManager().registerWorkItemHandler("Log", new SystemOutWorkItemHandler());
    ksession.getWorkItemManager().registerWorkItemHandler("Email", new SystemOutWorkItemHandler());
 
    params = new HashMap<String, Object>();
    // initialize process parameters.
    params.put("employee", "erics");
    params.put("reason", "Amazing demos for JBoss World!");
View Full Code Here

TOP

Related Classes of org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler

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.