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

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


   
    /**
     * @since OODT-205
     */
    public void testWorkflowConditions(){
      Workflow w = null;
      try{
        w = this.workflowRepository.getWorkflowById("urn:oodt:conditionsWorkflow");
      }
      catch(Exception e){
        fail(e.getMessage());
      }
     
      assertNotNull(w);
      assertNotNull(w.getConditions());
      assertTrue(w.getConditions().size() > 0);
      assertEquals(w.getConditions().size(), 1);
    }   
View Full Code Here


      assertTrue(w.getConditions().size() > 0);
      assertEquals(w.getConditions().size(), 1);
    }   

    public void testGetWorkflowByName() {
        Workflow w = null;

        try {
            w = workflowRepository.getWorkflowByName("backwardsTestWorkflow");
        } catch (RepositoryException e) {
            e.printStackTrace();
View Full Code Here

        validateBackwardsWorkflow(w);
    }

    public void testGetWorkflowById() {
        Workflow w = null;

        try {
            w = workflowRepository
                    .getWorkflowById("urn:oodt:backwardsTestWorkflow");
        } catch (RepositoryException e) {
View Full Code Here

 
  /**
   * @since OODT-205
   */
  public void testWorkflowConditions(){
    Workflow w = null;
    try{
      w = this.repo.getWorkflowById("urn:npp:GranuleMaps");
    }
    catch(Exception e){
      fail(e.getMessage());
    }
   
    assertNotNull(w);
    assertNotNull(w.getConditions());
    System.out.println("NUM CONDITIONS: "+w.getConditions().size());
    assertTrue(w.getConditions().size() > 0);
    assertEquals(w.getConditions().size(), 3);
  }
View Full Code Here

      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));
      workflow1.setConditions(Lists.newArrayList(condition1));
      workflows.put(workflow1.getId(), workflow1);

      Workflow workflow2 = new Workflow();
      workflow2.setId(WORKFLOW2_ID);
      workflow2.setName(WORKFLOW2_NAME);
      workflow2.setTasks(Lists.newArrayList(task1, task2, task4));
      workflow2.setConditions(Lists.newArrayList(condition1, condition4));
      workflows.put(workflow2.getId(), workflow2);

      Workflow workflow3 = new Workflow();
      workflow3.setId(WORKFLOW3_ID);
      workflow3.setName(WORKFLOW3_NAME);
      workflow3.setTasks(Lists.newArrayList(task3));
      workflow3.setConditions(new ArrayList<WorkflowCondition>());
      workflows.put(workflow3.getId(), workflow3);

      eventToWorkflowsMap.put(EVENT1_NAME, Lists.newArrayList(workflow1));
      eventToWorkflowsMap.put(EVENT2_NAME, Lists.newArrayList(workflow1,
            workflow2));
   }
View Full Code Here

    List<Workflow> workflows = this.wm.safeGetWorkflows();
    add(new ListView<Workflow>("workflow_list", workflows) {

      @Override
      protected void populateItem(ListItem<Workflow> item) {
        Workflow w = item.getModelObject();
        item.add(new Label("workflow_id", w.getId()));
        item.add(new Label("workflow_name", w.getName()));
        item.add(new Link<String>("workflow_link", new Model(w.getId())) {
          /*
           * (non-Javadoc)
           *
           * @see org.apache.wicket.markup.html.link.Link#onClick()
           */
 
View Full Code Here

      throws RepositoryException, EngineException {
    if (taskIds == null || (taskIds != null && taskIds.size() == 0))
      throw new RepositoryException(
          "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);
    }

    dynamicWorkflow.setId(this.repo.addWorkflow(dynamicWorkflow));
    dynamicWorkflow.setName("Dynamic Workflow-" + dynamicWorkflow.getId());

    Metadata met = new Metadata();
    met.addMetadata(metadata);

    WorkflowInstance inst = this.engine.startWorkflow(dynamicWorkflow, met);
View Full Code Here

        try {
            workflows = repo.getWorkflowsForEvent(eventName);

            if (workflows != null) {
                for (Iterator i = workflows.iterator(); i.hasNext();) {
                    Workflow w = (Workflow) i.next();
                    Hashtable workflow = XmlRpcStructFactory
                            .getXmlRpcWorkflow(w);
                    workflowList.add(workflow);
                }
            }
View Full Code Here

                            + eventName + ": Message: " + e.getMessage());
        }

        if (workflows != null) {
            for (Iterator i = workflows.iterator(); i.hasNext();) {
                Workflow w = (Workflow) i.next();
                LOG.log(Level.INFO, "WorkflowManager: Workflow " + w.getName()
                        + " retrieved for event " + eventName);

                Metadata m = new Metadata();
                m.addMetadata(metadata);

                try {
                    engine.startWorkflow(w, m);
                } catch (Exception e) {
                    e.printStackTrace();
                    throw new EngineException(
                            "Engine exception when starting workflow: "
                                    + w.getName() + ": Message: "
                                    + e.getMessage());
                }
            }
            return true;
        } else
View Full Code Here

            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);
View Full Code Here

TOP

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

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.