Examples of WorkItem


Examples of org.kie.runtime.process.WorkItem

        ProcessInstance processInstance = service.startProcess( "org.drools.test.TestProcess" );
        log.info( "Started process instance {}",
                  processInstance.getId() );

        TestWorkItemHandler handler = TestWorkItemHandler.getInstance();
        WorkItem workItem = handler.getWorkItem();
        assertNotNull( workItem );
        service.dispose();

        final Environment env = (Environment) ctx.getBean( "env" );
        /*Environment env = KnowledgeBaseFactory.newEnvironment();
        env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
                 ctx.getBean( "myEmf" ) );
        env.set( EnvironmentName.TRANSACTION_MANAGER,
                 ctx.getBean( "txManager" ) );
        */
        KieStoreServices kstore = (KieStoreServices) ctx.getBean( "kstore1" );
        KieBase kbase1 = (KieBase) ctx.getBean( "kbProcessWorkItems" );
        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
        processInstance = service.getProcessInstance( processInstance.getId() );
        assertNotNull( processInstance );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
        service.getWorkItemManager().completeWorkItem( workItem.getId(),
                                                       null );

        workItem = handler.getWorkItem();
        assertNotNull( workItem );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
        processInstance = service.getProcessInstance( processInstance.getId() );
        assertNotNull( processInstance );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
        service.getWorkItemManager().completeWorkItem( workItem.getId(),
                                                       null );

        workItem = handler.getWorkItem();
        assertNotNull( workItem );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
        processInstance = service.getProcessInstance( processInstance.getId() );
        service.dispose();

        service = kstore.loadKieSession( sessionId,
                                         kbase1,
                                         null,
                                         env );
        service.getWorkItemManager().completeWorkItem( workItem.getId(),
                                                       null );

        workItem = handler.getWorkItem();
        assertNull( workItem );
        service.dispose();
View Full Code Here

Examples of org.kite9.framework.server.WorkItem

            } else {
              throw new Kite9ProcessingException(
                  "Could not determine arguments for " + id);
            }
 
            WorkItem item = null;
            if (Modifier.isStatic(method.getModifiers())) {
              Object diagram = method.invoke(null, args);
              if (diagram != null) {
                item = new BasicWorkItem(diagram, name, id,
                    getContext().getProjectId(),
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.