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

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


          "Must specify task identifiers to build dynamic workflows!");

    Workflow dynamicWorkflow = new Workflow();

    for (String taskId : taskIds) {
      WorkflowTask task = this.repo.getWorkflowTaskById(taskId);
      if (task == null)
        throw new RepositoryException("Dynamic workflow task: [" + taskId
            + "] is not defined!");
      dynamicWorkflow.getTasks().add(task);
    }
View Full Code Here


    }

    public Hashtable getTaskById(String taskId) throws RepositoryException {
        try {
            WorkflowTask t = repo.getWorkflowTaskById(taskId);
            return XmlRpcStructFactory.getXmlRpcWorkflowTask(t);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RepositoryException(
                    "Exception getting task by id: Message: " + e.getMessage());
View Full Code Here

    }

    private void addTasksToDoc(Document doc, List tasks) {
        if (tasks != null && tasks.size() > 0) {
            for (Iterator i = tasks.iterator(); i.hasNext();) {
                WorkflowTask task = (WorkflowTask) i.next();
                doc.add(new Field("task_id", task.getTaskId(), Field.Store.YES,
                        Field.Index.UN_TOKENIZED));
                doc.add(new Field("task_name", task.getTaskName(),
                        Field.Store.YES, Field.Index.NO));
                doc.add(new Field("task_order",
                        String.valueOf(task.getOrder()), Field.Store.YES,
                        Field.Index.NO));
                doc.add(new Field("task_class",
                        task.getTaskInstanceClassName(), Field.Store.YES,
                        Field.Index.NO));

                addConditionsToDoc(task.getTaskId(), task.getConditions(), doc);
                addTaskConfigToDoc(task.getTaskId(), task.getTaskConfig(), doc);
            }
        }
    }
View Full Code Here

                            + "task list from Document!");
            return null;
        }

        for (int i = 0; i < taskIds.length; i++) {
            WorkflowTask task = new WorkflowTask();
            task.setOrder(Integer.parseInt(taskOrders[i]));
            task.setTaskName(taskNames[i]);
            task.setTaskId(taskIds[i]);
            task.setTaskInstanceClassName(taskClasses[i]);

            task.setConditions(toConditions(task.getTaskId(), doc));
            task.setTaskConfig(toTaskConfig(task.getTaskId(), doc));
            taskList.add(task);
        }

        return taskList;
    }
View Full Code Here

   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         WorkflowTask task = getClient().getTaskById(taskId);
         printer.println("Task: [id=" + task.getTaskId() + ", name="
               + task.getTaskName() + ", order=" + task.getOrder() + ", class="
               + task.getClass().getName() + ", numConditions="
               + task.getConditions().size() + ", configuration="
               + task.getTaskConfig().getProperties() + "]");
      } catch (Exception e) {
         throw new CmdLineActionException(
               "Failed to get task by id for taskId '" + taskId + "' : "
                     + e.getMessage(), e);
      }
View Full Code Here

      }
      // if parent doesn't have task or workflow set, then its parent
      // is null and it's a condition definition, just add it

    } else if (graph.getExecutionType().equals("task")) {
      WorkflowTask task = null;
      if (graph.getModelIdRef() != null && !graph.getModelIdRef().equals("")) {
        LOG.log(Level.FINER, "Model ID-Ref to: [" + graph.getModelIdRef() + "]");
        task = this.tasks.get(graph.getModelIdRef());
      } else {
        task = new WorkflowTask();
        task.setTaskId(graph.getModelId());
        task.setTaskName(graph.getModelName());
        task.setTaskConfig(convertToTaskConfiguration(staticMetadata));
        task.setTaskInstanceClassName(graph.getClazz());

        if (task.getTaskName() == null
            || (task.getTaskName() != null && task.getTaskName().equals(""))) {
          task.setTaskName(task.getTaskId());
        }
        this.tasks.put(graph.getModelId(), task);
      }

      graph.setTask(task);
View Full Code Here

    this.workflows.put(workflow.getId(), workflow);
    return workflow;
  }

  private WorkflowTask generateRedirector(String eventName) {
    WorkflowTask task = new WorkflowTask();
    WorkflowTaskConfiguration config = new WorkflowTaskConfiguration();
    config.addConfigProperty("eventName", eventName);
    task.setTaskId("redirector-" + UUID.randomUUID().toString());
    task.setTaskName("Redirector Task");
    task.setTaskInstanceClassName(BranchRedirector.class.getName());
    this.tasks.put(task.getTaskId(), task);
    return task;
  }
View Full Code Here

    return nodeList;
  }

  private WorkflowTask getGlobalWorkflowConditionsTask(String workflowName, String workflowId,
      List<WorkflowCondition> conditions) {
    WorkflowTask task = new WorkflowTask();
    task.setConditions(conditions);
    task.setTaskConfig(new WorkflowTaskConfiguration());
    task.setTaskId(workflowId + "-global-conditions-eval");
    task.setTaskName(workflowName + "-global-conditions-eval");
    task.setTaskInstanceClassName(NoOpTask.class.getName());
    this.tasks.put(task.getTaskId(), task);
    return task;
  }
View Full Code Here

    assertEquals(2, runnables.size());
    runner = new AsynchronousLocalEngineRunner();
    taskRunner = new TaskRunner(querier, runner);
    assertNotNull(taskRunner);
    Thread runnerThread = new Thread(taskRunner);
    WorkflowTask task = taskRunner
        .extractTaskFromProcessor((TaskProcessor) runnables.get(0));
    assertNotNull(task);
    testDir = new File(task.getTaskConfig().getProperty("TestDirPath"));
    assertNotNull(testDir);
    runnerThread.start();

    while (!testDir.exists()
        || (testDir.exists() && testDir.listFiles().length != 2)) {
View Full Code Here

      condition4.setConditionName(CONDITION4_NAME);
      condition4.setCondConfig(cConf);
      condition4.setConditionInstanceClassName("some.class.path");
      conditions.put(condition4.getConditionId(), condition4);

      WorkflowTask task1 = new WorkflowTask();
      task1.setTaskId(TASK1_ID);
      task1.setTaskName(TASK1_NAME);
      task1.setTaskConfig(tConf);
      task1.setConditions(Lists.newArrayList(condition1, condition2));
      tasks.put(task1.getTaskId(), task1);

      WorkflowTask task2 = new WorkflowTask();
      task2.setTaskId(TASK2_ID);
      task2.setTaskName(TASK2_NAME);
      task2.setTaskConfig(tConf);
      task2.setConditions(Lists.newArrayList());
      tasks.put(task2.getTaskId(), task2);

      WorkflowTask task3 = new WorkflowTask();
      task3.setTaskId(TASK3_ID);
      task3.setTaskName(TASK3_NAME);
      task3.setTaskConfig(tConf);
      task3.setConditions(Lists.newArrayList());
      tasks.put(task3.getTaskId(), task3);

      WorkflowTask task4 = new WorkflowTask();
      task4.setTaskId(TASK4_ID);
      task4.setTaskName(TASK4_NAME);
      task4.setTaskConfig(tConf);
      task4.setConditions(Lists.newArrayList(condition4));
      tasks.put(task4.getTaskId(), task4);

      Workflow workflow1 = new Workflow();
      workflow1.setId(WORKFLOW1_ID);
      workflow1.setName(WORKFLOW1_NAME);
      workflow1.setTasks(Lists.newArrayList(task1, task2));
View Full Code Here

TOP

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

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.