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

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


    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());

    if (workflowInstance.get("priority") != null) {
      Priority p = Priority.getPriority(Double
          .valueOf((String) workflowInstance.get("priority")));
    }
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

   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         XmlRpcWorkflowManagerClient client = getClient();
         WorkflowInstance inst = client.getWorkflowInstanceById(instanceId);
         if (inst == null) {
            throw new Exception(
                  "WorkflowManager returned null workflow instance");
         }
         printer.println("Instance: [id=" + inst.getId() + ", status="
               + inst.getStatus() + ", currentTask=" + inst.getCurrentTaskId()
               + ", workflow=" + inst.getWorkflow().getName()
               + ",wallClockTime="
               + client.getWorkflowWallClockMinutes(inst.getId())
               + ",currentTaskWallClockTime="
               + client.getWorkflowCurrentTaskWallClockMinutes(inst.getId())
               + "]");
      } catch (Exception e) {
         throw new CmdLineActionException(
               "Failed to get workflow instance information for"
                     + " instanceId '" + instanceId + "' : " + e.getMessage(),
View Full Code Here

        argList.add(wInstId);

        try {
            Hashtable workflowInstance = (Hashtable) client.execute(
                    "workflowmgr.getWorkflowInstanceById", argList);
            WorkflowInstance wInst = XmlRpcStructFactory
                    .getWorkflowInstanceFromXmlRpc(workflowInstance);
            return wInst;
        } catch (XmlRpcException e) {
            e.printStackTrace();
            throw new Exception(e.getMessage());
View Full Code Here

                    "workflowmgr.getWorkflowInstancesByStatus", argList);
            if (insts != null) {
                instsUnpacked = new Vector(insts.size());
                for (Iterator i = insts.iterator(); i.hasNext();) {
                    Hashtable hWinst = (Hashtable) i.next();
                    WorkflowInstance inst = XmlRpcStructFactory
                            .getWorkflowInstanceFromXmlRpc(hWinst);
                    instsUnpacked.add(inst);
                }
                return instsUnpacked;
            } else
View Full Code Here

                    argList);
            if (insts != null) {
                instsUnpacked = new Vector(insts.size());
                for (Iterator i = insts.iterator(); i.hasNext();) {
                    Hashtable hWinst = (Hashtable) i.next();
                    WorkflowInstance inst = XmlRpcStructFactory
                            .getWorkflowInstanceFromXmlRpc(hWinst);
                    instsUnpacked.add(inst);
                }
                return instsUnpacked;
            } else
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

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.