Package org.apache.agila.impl

Examples of org.apache.agila.impl.InstanceImpl


            return process.getBusinessProcessID();
        }
    }

    public Instance newInstance(BusinessProcessID processID, Map params) {
        InstanceImpl answer = new InstanceImpl();
        answer.setBusinessProcessID(processID);
        answer.setInstanceVariables(params);
        getHibernateTemplate().save(answer);
        getHibernateTemplate().flush();
        return answer;
    }
View Full Code Here


    public List listInstanceInfo() {
        List list = getHibernateTemplate().loadAll(InstanceImpl.class);
        List answer = new ArrayList(list.size());
        for (Iterator iter = list.iterator(); iter.hasNext();) {
            InstanceImpl instance = (InstanceImpl) iter.next();
            InstanceInfo info = new InstanceInfo(instance);
            answer.add(info);
        }
        return answer;
    }
View Full Code Here

        int running = 0;
        int completed = 0;

        List instances = getHibernateTemplate().loadAll(InstanceImpl.class);
        for (Iterator iter = instances.iterator(); iter.hasNext();) {
            InstanceImpl instance = (InstanceImpl) iter.next();

            int status = instance.getStatus();

            switch (status) {
                case Instance.STATUS_STOPPED:
                    stopped++;
                    break;
View Full Code Here

    }

    public Instance getInstanceByID( InstanceID instanceID ) {

        InstanceImpl retVal = null;

        Connection connection = null;

        try {
            String sql = "select * from bpm_instance" +
                " where instanceid = " + instanceID.getID();

            connection = getConnection();
            Statement statement = connection.createStatement();
            ResultSet result = statement.executeQuery( sql );
            result.next();

            retVal = new InstanceImpl();
            retVal.setInstanceID( new InstanceID(
                result.getInt( "instanceid" ) ) );
            retVal.setBusinessProcessID( new BusinessProcessID(
                result.getInt( "processid" ) ) );
            retVal.setGraphName( result.getString( "graphname" ) );
            retVal.setInstanceVariables(
                SerializeUtil.deserializeAppParam( result.getBytes( "params" ) ) );
            retVal.setStartDate( result.getDate( "startdate" ) );
            retVal.setLastStepDate( result.getDate( "stepdate" ) );
            retVal.setStatus( result.getInt( "status" ) );

            result.close();
            statement.close();
        } catch( SQLException e ) {
            throw new RuntimeException( e );
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

        Iterator it = hm.values().iterator();

        while(it.hasNext()) {

            InstanceImpl impl = (InstanceImpl) it.next();

            data.add(new InstanceInfo(impl));
        }

        return data;
View Full Code Here

        int completed = 0;

        Iterator it = hm.values().iterator();

        while(it.hasNext()) {
            InstanceImpl impl = (InstanceImpl) it.next();

            switch(impl.getStatus()){

                case Instance.STATUS_RUNNING :
                    running++;
                    break;
View Full Code Here

TOP

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

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.