Package org.apache.agila.model

Examples of org.apache.agila.model.BusinessProcessID


        rootNode.setNodeId(new NodeID(1));
        rootNode.setDisplayName("root");

        bProcess.setRoot(rootNode);
        BusinessProcessID bpId = bpService.addGraph(bProcess);

        // then create a map of parameters
        Map params = new HashMap();
        params.put("foo", "foo value");
        params.put("bar", "bar value");
View Full Code Here


    public void testSave() {
        // get a business process id
        BusinessProcessImpl bProcess = new BusinessProcessImpl();
        String graphName = "Graph" + count++;
        bProcess.setName(graphName);
        BusinessProcessID bpId = bpService.addGraph(bProcess);

        // then create a map of parameters
        Map params = new HashMap();
        params.put("foo", "foo value");
        params.put("bar", "bar value");
View Full Code Here

public class BusinessProcessServiceTestCase extends TestCase {

    AbstractBusinessProcessService bpService;

    public void testAddGraph_String() {
        BusinessProcessID bpID = bpService.addGraph( getXMLAsString() );

        assertNotNull( bpID );
    }
View Full Code Here

        rootNode.setDisplayName("root");

        bProcess.setRoot( rootNode );

        // add the business process graph
        BusinessProcessID bpId = bpService.addGraph( bProcess );

        // confirm that the graph has been saved by retrieving all current
        // graphs
        List processList = bpService.getCurrentProcessInfos();
        assertNotNull( processList );
View Full Code Here

        assertEquals( "40", instance.getInstanceVariables().get( "numdays" ) );
    }

    private InstanceID createInstance() {
        // Get the workflow to instantiate
        BusinessProcessID businessProcessID = businessProcessService.getGraphIDByName( "Leave Application Workflow" );
        assertNotNull( businessProcessID );

        BusinessProcessInfo businessProcessInfo = businessProcessService.getInfoByID( businessProcessID );
        assertNotNull( businessProcessInfo );

        // Fill required variables with value
        Map requiredVariables = new HashMap();
        requiredVariables.put( "numdays", "10" );

        // Instantiate the workflow
        InstanceID instanceID = engine.startNewInstance( businessProcessID.getID(), requiredVariables );
        assertNotNull( instanceID );

        return( instanceID );
    }
View Full Code Here

    public void start_process_instance( HttpServletRequest request, HttpServletResponse response ) throws ServletException,
            IOException {

        String name = request.getParameter( "name" );

        BusinessProcessID proc = graphManager.getGraphIDByName(name);

        BusinessProcessInfo businessProcessInfo = graphManager.getInfoByID( proc );

        List requiredVariables = businessProcessInfo.getRequiredVariables();

        if( requiredVariables.size() > 0 ) {
            request.setAttribute( "processName", name );
            request.setAttribute( "businessProcessID", new Integer( proc.getID() ) );
            request.setAttribute( "variables", requiredVariables );
            request.setAttribute( "pageToDisplay", "/WEB-INF/view/initVars.jsp" );
        } else {
            startNewInstance( request, proc, name, new HashMap());
View Full Code Here

    }

    public void start_process_instance_with_variables( HttpServletRequest request,
        HttpServletResponse response ) throws ServletException, IOException {

        BusinessProcessID businessProcessID = new BusinessProcessID( Integer.parseInt( request.getParameter( "businessProcessID" ) ) );
        BusinessProcessInfo businessProcessInfo = graphManager.getInfoByID( businessProcessID );

        // Retrieve the list of variables to know which parameter names to retrieve.
        // TODO probably there's a better way to do this. A call to getRequiredVariables() slows down the system.
        List requiredVariables = businessProcessInfo.getRequiredVariables();
View Full Code Here

            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) {
            throw new RuntimeException (e);
View Full Code Here

            initDir();
            File f = new File (xmlDir, bpm.getName()+".xml");
            PrintWriter pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(f), "UTF-8"));
            pw.println(bpm.getGraphAsXML());
            pw.close();
            BusinessProcessID id = new BusinessProcessID(generateKey());
            ((BusinessProcessImpl)bpm).setBusinessProcessID(id);
            addToCache(bpm);
        } catch (Exception e) {
            throw new RuntimeException (e);
        }
View Full Code Here

    public void setBusinessProcessID(BusinessProcessID id) {
        this.id = new Integer(id.getID());
    }

    public BusinessProcessID getBusinessProcessID() {
        return id != null ? new BusinessProcessID(id.intValue()) : null;
    }
View Full Code Here

TOP

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

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.