Package org.apache.agila.impl

Examples of org.apache.agila.impl.NodeContextImpl


        BusinessProcess graph = wm.getGraphByID(
                eiSvc.getInstanceByID(tk.getInstanceID()).getBusinessProcessID());

        Node n = graph.getNode(tk.getCurrentNodeID());

        NodeContextImpl nc = new NodeContextImpl(n, ei, timerService,
                taskService, notificationService);

        nc.setAppData(msg.getAppData());

        /*
         * now examine the state of this token and process accordingly.
         */

        switch(tk.getCurrentState()) {

            /*
             *  in 'pre start' state for this node.  Setup, call the doStart()
             *  method, and then based on the return from doStart(), either
             *  create and fling another message back into the queue, or stop
             *  and wait for response from outside
             */

            case Token.PRE : {

                logger.debug("processMessage : Current state = PRE for " + tk);

                /**
                 *  must send new token b/c it can be used as the current token...
                 */

                Token newToken = tokenService.newToken(tk.getInstanceID(),
                                                      tk.getCurrentNodeID(),
                                                      Token.MID);

                nc.setCurrentExecutionToken(tk);
                nc.setNextExecutionToken(newToken);

                boolean ret = n.doStart(nc);

                if (ret == true) {

                    EngineMessage newMsg = new EngineMessageImpl();

                    newMsg.setCurrentTokenID(newToken.getTokenID());

                    queue.enqueue(newMsg);
                }

                break;
            }

            /*
             *  this state is 'between' doStart() and doEnd().  So prepare
             *  context and call doEnd()
             */

            case Token.MID : {

                logger.debug("processMessage : Current state = MID for " + tk);

                nc.setCurrentExecutionToken(tk);

                /*
                 *  call doEnd() and get the set of conenctions that we need
                 *  to traverse, or null if we are to stop
                 */
 
View Full Code Here


    public Renderer getRendererForTask(TaskID taskID, Class rendererType) {

        Token token = getTokenForTaskID(taskID);
        Node node = getNodeForToken(token);

        NodeContextImpl ctx = new NodeContextImpl(node,
                instanceService.getInstanceByID(token.getInstanceID()),
                timerService, this, notificationService);

        ctx.setCurrentExecutionToken(token);

        if (node instanceof TaskActivity) {
            return ((TaskActivity) node).getRenderer(ctx, rendererType);
        }
View Full Code Here


        Token token = getTokenForTaskID(taskID);
        Node node = getNodeForToken(token);

        NodeContextImpl ctx = new NodeContextImpl(node,
                instanceService.getInstanceByID(token.getInstanceID()),
                timerService, this, notificationService);

        ctx.setCurrentExecutionToken(token);

        if (node instanceof TaskActivity) {
            return ((TaskActivity) node).getResponseHandler(ctx, handlerType);
        }
View Full Code Here

TOP

Related Classes of org.apache.agila.impl.NodeContextImpl

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.