Package org.apache.agila.model

Examples of org.apache.agila.model.BusinessProcess


   
    public  BusinessProcessID getGraphIDByName( String name ) {
        if (name == null)
            return null;
        init();
        BusinessProcess bpm =  (BusinessProcess)nameMap.get(name.trim());
        if (bpm == null)
            return null;
        return bpm.getBusinessProcessID();
    }
View Full Code Here


            idMap.clear();
            nameMap.clear();
            File[] files = xmlDir.listFiles();
            for (int i=0; i<files.length; i++) {
                File f = files[i];      
                BusinessProcess bpm = XMLUtil.deserializeXML(new InputStreamReader(new FileInputStream(f), "UTF-8"));
                BusinessProcessID id = new BusinessProcessID(generateKey());           
                ((BusinessProcessImpl)bpm).setBusinessProcessID(id);
                addToCache(bpm);
            }
        } catch (Exception e) {
View Full Code Here

        /*
         *   // TODO - handle 'verb' in message
         */

        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());
View Full Code Here

        Instance retVal = null;

        Connection connection = null;

        try {
            BusinessProcess businessProcess = getGraphByID( businessProcessID );

            String sql = "insert into bpm_instance" +
                " ( instanceid, processid, graphname, params, status )" +
                " values ( ?, ?, ?, ?, ? )";

            int instanceID = generateKey();

            connection = getConnection();

            PreparedStatement preparedStatement =
                connection.prepareStatement( sql );

            preparedStatement.setInt( 1, instanceID );
            preparedStatement.setInt( 2, businessProcessID.getID() );
            preparedStatement.setString( 3, businessProcess.getName() );
            preparedStatement.setBytes( 4, SerializeUtil.serializeAppParam( params ) );
            preparedStatement.setInt( 5, Instance.STATUS_RUNNING );
            preparedStatement.execute();
            preparedStatement.close();
View Full Code Here

    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

        /*
         * 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);

        /*
         * and a message
View Full Code Here

        return( null );
    }

    private void populateNodeTrack(InstanceInfo info) {
        BusinessProcess businessProcess =
                businessProcessService.getGraphByID(info.getBusinessProcessID());

         List activeTokens = tokenService.getActiveTokensForInstance(info.getInstanceID());

         List nodes = new ArrayList();

         for( Iterator iterator = activeTokens.iterator(); iterator.hasNext(); ) {
             Token token = (Token) iterator.next();
             NodeID nodeID = token.getCurrentNodeID();
             String displayName = businessProcess.getNode(nodeID).getDisplayName();

             nodes.add( displayName );
         }

        info.setNodeTrack((String[]) nodes.toArray(new String[nodes.size()]));
View Full Code Here

        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

        this.graphService = graphService;
        this.queue = queue;
    }

    public void addBusinessProcess( Reader reader ) {
        BusinessProcess newGraph = XMLUtil.deserializeXML( reader );

        graphService.addGraph(newGraph.getGraphAsXML());
    }
View Full Code Here

        BusinessProcessID id = new BusinessProcessID(processID);
        InstanceID instanceID = eiSvc.newInstance(id, params);

        Instance instance = eiSvc.getInstanceByID(instanceID);

        BusinessProcess proc = graphService.getGraphByID(id);

        instance.setGraphName(proc.getName());
        eiSvc.save(instance);


        eiSvc.start(instanceID);
View Full Code Here

TOP

Related Classes of org.apache.agila.model.BusinessProcess

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.