Package org.jbpm

Examples of org.jbpm.JbpmContext.loadProcessInstance()


    processInstance = saveAndReload(processInstance);
    processInstance.signal();
    jbpmContext.save(processInstance);
   
    JbpmContext concurrentContext = jbpmConfiguration.createJbpmContext();
    ProcessInstance sameProcessInstanceInDifferentSession = concurrentContext.loadProcessInstance(processInstance.getId());
    sameProcessInstanceInDifferentSession.end();
    concurrentContext.save(sameProcessInstanceInDifferentSession);
    log.debug("closing concurrent context");
    concurrentContext.close();
   
View Full Code Here


        if (suspendProcess)
        {
            final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
            final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
           
            final ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId) ;
            processInstance.suspend() ;
           
            jbpmContext.close() ;
        }
    }
View Full Code Here

        if (suspendProcess)
        {
            final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
            final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
           
            final ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId) ;
            processInstance.resume() ;
           
            jbpmContext.close() ;
        }
    }
View Full Code Here

    @Test
    public void timeOut() throws Exception
    {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        processInstance.signal();
        assertEquals("wait1",token.getNode().getName());
        jbpmContext.close();
View Full Code Here

        while (true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {}
            jbpmContext = jbpmConfiguration.createJbpmContext();
            processInstance = jbpmContext.loadProcessInstance(processInstanceId);
            token = processInstance.getRootToken();
            String currentNode = token.getNode().getName();
            System.out.println(seconds++ + " " + currentNode);
            jbpmContext.close();
            if (currentNode.equals("end")) break;
View Full Code Here

    @Test
    public void timeOut() throws Exception
    {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        assertEquals("start",token.getNode().getName());
        //Move the process to service1
        processInstance.signal();
View Full Code Here

        jbpmContext.close();
        //Our timer fires after 1000 millies, so let's wait for that
        int seconds=0;
        while(true) {
            jbpmContext = jbpmConfiguration.createJbpmContext();
            processInstance = jbpmContext.loadProcessInstance(processInstanceId);
            token = processInstance.getRootToken();
            logger.info(seconds++ + " Node=" + token.getNode().getName());
            if ("ExceptionHandling".equals(token.getNode().getName())) break; //we're done waiting
            if (seconds > 20) break; // the timer must not have fired so we are bailing (and failing)
            jbpmContext.close();
View Full Code Here

     */
    @Test
    public void takeExceptionTransition() {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        assertEquals("start",token.getNode().getName());
        //Move the process to service1
        processInstance.signal();
View Full Code Here

     */
    @Test
    public void takeConditionalTransition() {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        assertEquals("start",token.getNode().getName());
        //Move the process to service1
        processInstance.signal();
View Full Code Here

     */
    @Test
    public void doNotTakeConditionalTransition() {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        assertEquals("start",token.getNode().getName());
        //Move the process to service1
        processInstance.signal();
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.