Package org.apache.agila.engine

Examples of org.apache.agila.engine.Instance


     * Inserts a new instance in the database
     */
    public Instance newInstance( BusinessProcessID businessProcessID,
            Map params) {

        Instance retVal = null;

        Connection connection = null;

        try {
            BusinessProcess businessProcess = getGraphByID( businessProcessID );
View Full Code Here


            ResultSet result = statement.executeQuery( sql );

            retVal = new ArrayList();

            while( result.next() ) {
                Instance instance = getInstanceByID(
                    new InstanceID( result.getInt( "instanceid" ) ) );

                InstanceInfo ii = new InstanceInfo(instance);

                retVal.add(ii);
View Full Code Here

        this.logService = logger;
    }

    public InstanceID newInstance(BusinessProcessID processID, Map params) {

        Instance ei = internalCreate(processID, params);

        BusinessProcess graph = businessProcessService.getGraphByID(processID);

        if (graph == null) {
            logService.error("Unable to get process for ID = " + processID);
            return null;
        }

        ei.setGraphName(graph.getName());

        save(ei);

        return ei.getInstanceID();
    }
View Full Code Here

        return ei.getInstanceID();
    }

    public void start(InstanceID id) {

        Instance instance = getInstanceByID(id);

        /*
         * now make a token
         */

        BusinessProcess bp =  businessProcessService.getGraphByID(instance.getBusinessProcessID());

        InstanceID instanceID = instance.getInstanceID();
        Node root = bp.getRoot();
        NodeID nodeId = root.getNodeId();
        Token token = tokenService.newToken(instanceID, nodeId, Token.PRE);

        /*
 
View Full Code Here

        return internalGetByID(id);
    }

    public InstanceInfo getInstanceInfoByID(InstanceID id) {

        Instance instance = getInstanceByID(id);

        InstanceInfo info = new InstanceInfo(instance);
        populateNodeTrack(info);

        return info;
View Full Code Here


    private Node getNodeForToken(Token token) {

        InstanceID instanceID = token.getInstanceID();
        Instance instance = instanceService.getInstanceByID(instanceID);

        BusinessProcessID bpid = businessProcessService.getGraphIDByName(instance.getGraphName());

        BusinessProcess bp = businessProcessService.getGraphByID(bpid);

        return bp.getNode(token.getCurrentNodeID());
    }
View Full Code Here

     * @param processID
     * @param params
     * @return
     */
    protected Instance internalCreate(BusinessProcessID processID, Map params) {
        Instance ei = new InstanceImpl();

        ei.setBusinessProcessID(processID);
        ei.setInstanceID(new InstanceID(++counter));
        ei.setInstanceVariables(params);
        ei.setStatus( Instance.STATUS_RUNNING );

        hm.put(ei.getInstanceID(), ei);

        return ei;
    }
View Full Code Here

TOP

Related Classes of org.apache.agila.engine.Instance

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.