Package org.apache.oodt.cas.workflow.structs

Examples of org.apache.oodt.cas.workflow.structs.WorkflowInstance


     *
     * @see org.apache.oodt.cas.workflow.engine.WorkflowEngine#getCurrentTaskWallClockMinutes(java.lang.String)
     */
    public double getCurrentTaskWallClockMinutes(String workflowInstId) {
        // get the workflow instance that we're talking about
        WorkflowInstance inst = safeGetWorkflowInstanceById(workflowInstId);
        return getCurrentTaskWallClockMinutes(inst);
    }
View Full Code Here


     *
     * @see org.apache.oodt.cas.workflow.engine.WorkflowEngine#getWorkflowInstanceMetadata(java.lang.String)
     */
    public Metadata getWorkflowInstanceMetadata(String workflowInstId) {
      // okay, try and look up that worker
      WorkflowInstance wInst = null;
     
      try{
        wInst = this.instRep.getWorkflowInstanceById(workflowInstId);
            if (wInst != null) {
            // try and get the metadata
            // from the workflow instance repository (as it was persisted)
                return wInst.getSharedContext();
            }
        } catch (InstanceRepositoryException e) {
                LOG.log(Level.FINEST,
                        "WorkflowEngine: Attempt to get metadata "
                                + "for workflow instance id: " + workflowInstId
                                + ", however, this engine is "
                                + "not tracking its execution and the id: ["
                                + workflowInstId + "] "
                                + "was never persisted to "
                                + "the instance repository");
                e.printStackTrace();
                return new Metadata();
        }

        return wInst.getSharedContext();
    }
View Full Code Here

     *
     * @see org.apache.oodt.cas.workflow.engine.WorkflowEngine#getWallClockMinutes(java.lang.String)
     */
    public double getWallClockMinutes(String workflowInstId) {
        // get the workflow instance that we're talking about
        WorkflowInstance inst = safeGetWorkflowInstanceById(workflowInstId);
        return getWallClockMinutes(inst);
    }
View Full Code Here

            throws InstanceRepositoryException {
        Connection conn = null;
        Statement statement = null;
        ResultSet rs = null;

        WorkflowInstance workflowInst = null;

        try {
            conn = dataSource.getConnection();
            statement = conn.createStatement();

            String getWorkflowSql = "SELECT * from workflow_instances "
                    + "WHERE workflow_instance_id = " + workflowInstId;

            LOG.log(Level.FINE, "getWorkflowInstanceById: Executing: "
                    + getWorkflowSql);
            rs = statement.executeQuery(getWorkflowSql);

            while (rs.next()) {
                workflowInst = DbStructFactory.getWorkflowInstance(rs);
                // add its metadata
                workflowInst
                        .setSharedContext(getWorkflowInstanceMetadata(workflowInst
                                .getId()));
            }

        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

                    + getWorkflowSql);
            rs = statement.executeQuery(getWorkflowSql);

            workflowInsts = new Vector();
            while (rs.next()) {
                WorkflowInstance workflowInst = DbStructFactory
                        .getWorkflowInstance(rs);
                // add its metadata
                workflowInst
                        .setSharedContext(getWorkflowInstanceMetadata(workflowInst
                                .getId()));
                workflowInsts.add(workflowInst);
            }

        } catch (Exception e) {
View Full Code Here

                    + getWorkflowSql);
            rs = statement.executeQuery(getWorkflowSql);

            workflowInsts = new Vector();
            while (rs.next()) {
                WorkflowInstance workflowInst = DbStructFactory
                        .getWorkflowInstance(rs);
                // add its metadata
                workflowInst
                        .setSharedContext(getWorkflowInstanceMetadata(workflowInst
                                .getId()));
                workflowInsts.add(workflowInst);
            }

        } catch (Exception e) {
View Full Code Here

        // populate it
        // persist it
        // add it to the worker map
        // start it

        WorkflowInstance wInst = new WorkflowInstance();
        wInst.setWorkflow(workflow);
        wInst.setCurrentTaskId(((WorkflowTask) workflow.getTasks().get(0))
                .getTaskId());
        wInst.setSharedContext(metadata);
        wInst.setStatus(CREATED);
        persistWorkflowInstance(wInst);

        IterativeWorkflowProcessorThread worker = new IterativeWorkflowProcessorThread(
                wInst, instRep, this.wmgrUrl);
        worker.setRClient(rClient);
        workerMap.put(wInst.getId(), worker);

        wInst.setStatus(QUEUED);
        persistWorkflowInstance(wInst);

        try {
            pool.execute(worker);
        } catch (InterruptedException e) {
View Full Code Here

     *
     * @see org.apache.oodt.cas.workflow.engine.WorkflowEngine#getCurrentTaskWallClockMinutes(java.lang.String)
     */
    public double getCurrentTaskWallClockMinutes(String workflowInstId) {
        // get the workflow instance that we're talking about
        WorkflowInstance inst = safeGetWorkflowInstanceById(workflowInstId);
        return getCurrentTaskWallClockMinutes(inst);
    }
View Full Code Here

                .get(workflowInstId);
        if (worker == null) {
            // try and get the metadata
            // from the workflow instance repository (as it was persisted)
            try {
                WorkflowInstance inst = instRep
                        .getWorkflowInstanceById(workflowInstId);
                return inst.getSharedContext();
            } catch (InstanceRepositoryException e) {
                LOG.log(Level.FINEST,
                        "WorkflowEngine: Attempt to get metadata "
                                + "for workflow instance id: " + workflowInstId
                                + ", however, this engine is "
View Full Code Here

     *
     * @see org.apache.oodt.cas.workflow.engine.WorkflowEngine#getWallClockMinutes(java.lang.String)
     */
    public double getWallClockMinutes(String workflowInstId) {
        // get the workflow instance that we're talking about
        WorkflowInstance inst = safeGetWorkflowInstanceById(workflowInstId);
        return getWallClockMinutes(inst);
    }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.workflow.structs.WorkflowInstance

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.