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

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


    }

    public void testCurrentTaskWallClockTime() {
        // at first, there is no start date time
        WorkflowInstance inst = new WorkflowInstance();
        WorkflowTask task = new WorkflowTask();
        task.setTaskId("urn:oodt:testTask");
        ParentChildWorkflow workflow = new ParentChildWorkflow(new Graph());
        workflow.getTasks().add(task);
        inst.setParentChildWorkflow(workflow);
        inst.setCurrentTaskId("urn:oodt:testTask");
        assertEquals(Double.valueOf(0.0), Double
View Full Code Here


   @SuppressWarnings("unchecked")
   @Override
   public List<WorkflowCondition> getConditionsByTaskName(String taskName)
         throws RepositoryException {
      List<WorkflowCondition> conditions = Lists.newArrayList();
      WorkflowTask task = getWorkflowTaskByName(taskName);
      if (task != null) {
         conditions.addAll(task.getConditions());
      }
      return conditions;
   }
View Full Code Here

   @SuppressWarnings("unchecked")
   @Override
   public List<WorkflowCondition> getConditionsByTaskId(String taskId)
         throws RepositoryException {
      List<WorkflowCondition> conditions = Lists.newArrayList();
      WorkflowTask task = getWorkflowTaskById(taskId);
      if (task != null) {
         conditions.addAll(Lists.newArrayList(task.getConditions()));
      }
      return conditions;
   }
View Full Code Here

   }

   @Override
   public WorkflowTaskConfiguration getConfigurationByTaskId(String taskId)
         throws RepositoryException {
      WorkflowTask task = getWorkflowTaskById(taskId);
      if (task != null) {
         return task.getTaskConfig();
      }
      return null;
   }
View Full Code Here

                notReplacedPath);

    }

    public void testMultipleConditions() {
        WorkflowTask multiTask = null;

        try {
            multiTask = workflowRepository
                    .getWorkflowTaskById("urn:oodt:TestMultiConditionTask");
        } catch (Exception e) {
            fail(e.getMessage());
        }

        assertNotNull(multiTask);
        assertNotNull(multiTask.getConditions());
        assertEquals(2, multiTask.getConditions().size());

        boolean gotTrueCond = false, gotFalseCond = false;

        for (int i = 0; i < multiTask.getConditions().size(); i++) {
            WorkflowCondition c = (WorkflowCondition) multiTask.getConditions()
                    .get(i);
            assertNotNull(c);
            if (c.getConditionName().equals("True Condition")) {
                gotTrueCond = true;
            } else if (c.getConditionName().equals("False Condition")) {
View Full Code Here

    private void validateBackwardsWorkflowTasks(List tasks) {
        assertNotNull(tasks);
        assertEquals(2, tasks.size());

        WorkflowTask t1 = (WorkflowTask) tasks.get(0);
        assertEquals("Goodbye World", t1.getTaskName());
        assertEquals("urn:oodt:GoodbyeWorld", t1.getTaskId());
        assertEquals(1, t1.getOrder());
        validateTaskConfiguration(t1.getTaskConfig());
        validateTaskCondition(t1.getConditions());

        WorkflowTask t2 = (WorkflowTask) tasks.get(1);
        assertEquals("Hello World", t2.getTaskName());
        assertEquals("urn:oodt:HelloWorld", t2.getTaskId());
        assertEquals(2, t2.getOrder());
        validateTaskConfiguration(t2.getTaskConfig());
        validateTaskCondition(t2.getConditions());

    }
View Full Code Here

  public QuerierAndRunnerUtils() {
    this.dateGen = 0;
  }
 
  public WorkflowTask getTask(File testDir){
    WorkflowTask task = new WorkflowTask();
    task.setConditions(Collections.emptyList());
    task.setRequiredMetFields(Collections.emptyList());
    task.setTaskId("urn:cas:workflow:tester");
    task.setTaskInstanceClassName(SimpleTester.class.getName());
    task.setTaskName("Tester");
    WorkflowTaskConfiguration config = new WorkflowTaskConfiguration();
    config.addConfigProperty("TestDirPath",
        testDir.getAbsolutePath().endsWith("/") ? testDir.getAbsolutePath()
            : testDir.getAbsolutePath() + "/");
    task.setTaskConfig(config);
    return task;
  }
View Full Code Here

   * @param id
   */
  public WorkflowTaskViewer(String id, String wmUrlStr, String taskId, final Class<? extends WebPage> conditionPage) {
    super(id);
    this.wm = new WorkflowMgrConn(wmUrlStr);
    final WorkflowTask task = this.wm.safeGetTaskById(taskId);

    add(new Label("workflow_task_id", task.getTaskId()));
    add(new Label("workflow_task_name", task.getTaskName()));
    add(new Label("workflow_task_class", task.getTaskInstanceClassName()));

    List<String> taskConfigMetKeyNames = Arrays.asList(task.getTaskConfig()
        .getProperties().keySet().toArray(
            new String[task.getTaskConfig().getProperties().size()]));
    Collections.sort(taskConfigMetKeyNames);

    add(new ListView<String>("workflow_config", new ListModel<String>(taskConfigMetKeyNames)){
   
      @Override
      protected void populateItem(ListItem<String> item) {
        String configMetKeyName = item.getModelObject();
        String configMetKeyValue = task.getTaskConfig().getProperty(configMetKeyName);
       
        item.add(new Label("workflow_config_pname", configMetKeyName));
        item.add(new Label("workflow_config_pvalue", configMetKeyValue));
      }
    });
   
    add(new ListView<WorkflowCondition>("workflow_conditions", new ListModel<WorkflowCondition>(task.getConditions())){
      /* (non-Javadoc)
       * @see org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem)
       */
      @Override
      protected void populateItem(ListItem<WorkflowCondition> item) {
View Full Code Here

          "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

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.