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

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


            LOG.log(Level.INFO, "Getting workflow instances: retrieved: "
                    + workflowInsts.size() + " instances");

            try {
                for (Iterator i = workflowInsts.iterator(); i.hasNext();) {
                    WorkflowInstance wInst = (WorkflowInstance) i.next();
                    // pick up the description of the workflow
                    Workflow wDesc = repo.getWorkflowById(wInst.getWorkflow()
                            .getId());
                    // TODO: hack for now, fix this, we shouldn't have to cast
                    // here, bad
                    // design
                    wInst.setWorkflow(wDesc);
                    Hashtable workflowInstance = XmlRpcStructFactory
                            .getXmlRpcWorkflowInstance(wInst);
                    workflowInstances.add(workflowInstance);
                }
                return workflowInstances;
View Full Code Here


        met.addMetadata(metadata);
        return this.engine.updateMetadata(workflowInstId, met);
    }

    public synchronized boolean updateWorkflowInstance(Hashtable workflowInst) {
        WorkflowInstance wInst = XmlRpcStructFactory
                .getWorkflowInstanceFromXmlRpc(workflowInst);
        return doUpdateWorkflowInstance(wInst);

    }
View Full Code Here

    }

    public synchronized boolean setWorkflowInstanceCurrentTaskStartDateTime(
            String wInstId, String startDateTimeIsoStr) {
        WorkflowInstance wInst = null;
        try {
            wInst = this.engine.getInstanceRepository()
                    .getWorkflowInstanceById(wInstId);
        } catch (InstanceRepositoryException e) {
            e.printStackTrace();
            return false;
        }
        wInst.setCurrentTaskStartDateTimeIsoStr(startDateTimeIsoStr);
        return doUpdateWorkflowInstance(wInst);
    }
View Full Code Here

        return doUpdateWorkflowInstance(wInst);
    }

    public synchronized boolean setWorkflowInstanceCurrentTaskEndDateTime(
            String wInstId, String endDateTimeIsoStr) {
        WorkflowInstance wInst = null;
        try {
            wInst = this.engine.getInstanceRepository()
                    .getWorkflowInstanceById(wInstId);
        } catch (InstanceRepositoryException e) {
            e.printStackTrace();
            return false;
        }
        wInst.setCurrentTaskEndDateTimeIsoStr(endDateTimeIsoStr);
        return doUpdateWorkflowInstance(wInst);
    }
View Full Code Here

        return doUpdateWorkflowInstance(wInst);
    }

    public synchronized boolean updateWorkflowInstanceStatus(
            String workflowInstanceId, String status) throws Exception {
        WorkflowInstance wInst = null;
        try {
            wInst = engine.getInstanceRepository().getWorkflowInstanceById(
                    workflowInstanceId);
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }

        wInst.setStatus(status);
        return doUpdateWorkflowInstance(wInst);
    }
View Full Code Here

    }

    private void populateWorkflows(List wInsts) {
        if (wInsts != null && wInsts.size() > 0) {
            for (Iterator i = wInsts.iterator(); i.hasNext();) {
                WorkflowInstance wInst = (WorkflowInstance) i.next();
                wInst.setWorkflow(safeGetWorkflowById(wInst.getWorkflow()
                        .getId()));
            }
        }
    }
View Full Code Here

        List wInsts = new Vector();

        if (instsVector != null && instsVector.size() > 0) {
            for (Iterator i = instsVector.iterator(); i.hasNext();) {
                Hashtable wInstHash = (Hashtable) i.next();
                WorkflowInstance inst = getWorkflowInstanceFromXmlRpc(wInstHash);
                wInsts.add(inst);
            }
        }

        return wInsts;
View Full Code Here

    public static Vector getXmlRpcWorkflowInstances(List wInsts) {
        Vector instsVector = new Vector();

        if (wInsts != null && wInsts.size() > 0) {
            for (Iterator i = wInsts.iterator(); i.hasNext();) {
                WorkflowInstance inst = (WorkflowInstance) i.next();
                instsVector.add(getXmlRpcWorkflowInstance(inst));
            }
        }

        return instsVector;
View Full Code Here

        return workflowInstance;
    }

    public static WorkflowInstance getWorkflowInstanceFromXmlRpc(
            Hashtable workflowInstance) {
        WorkflowInstance wInst = new WorkflowInstance();
        wInst
                .setCurrentTaskId((String) workflowInstance
                        .get("current_task_id"));
        wInst.setStatus((String) workflowInstance.get("status"));
        wInst.setId((String) workflowInstance.get("id"));
        wInst.setWorkflow(getWorkflowFromXmlRpc((Hashtable) workflowInstance
                .get("workflow")));
        wInst.setStartDateTimeIsoStr((String) workflowInstance
                .get("start_date_time"));
        wInst.setEndDateTimeIsoStr((String) workflowInstance
                .get("end_date_time"));
        wInst.setCurrentTaskStartDateTimeIsoStr((String) workflowInstance
                .get("current_task_start_date_time"));
        wInst.setCurrentTaskEndDateTimeIsoStr((String) workflowInstance
                .get("current_task_end_date_time"));
        if (workflowInstance.get("sharedContext") != null) {
            Metadata met = new Metadata();
            met.addMetadata((Hashtable) workflowInstance.get("sharedContext"));
            wInst.setSharedContext(met);
        } else
            wInst.setSharedContext(new Metadata());

        return wInst;
    }
View Full Code Here

    }

    System.out.println(REPORT_LINE_SEPARATOR);
    System.out.println("Generated from workflow:");
    System.out.println("");
    WorkflowInstance inst = null;

    try {
      inst = getWorkflowInstanceById(wm.safeGetWorkflowInstances(), met
          .getMetadata(JOB_ID));

      System.out.println(inst.getWorkflow().getName() + ": ID: ["
          + inst.getId() + "]");
      System.out.println("Status: " + inst.getStatus());
      List wInstProds = pedigree.getWorkflowInstProds(inst.getId());
      if (wInstProds != null && wInstProds.size() > 0) {
        System.out.println("Associated products:");
        System.out.println("");
        for (Iterator i = wInstProds.iterator(); i.hasNext();) {
          Product wInstProd = (Product) i.next();
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.