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

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


public class TestGenericWorkflowObjectFactory extends TestCase {

  public void testCreateTask() {
    String taskClass = "org.apache.oodt.cas.workflow.examples.LongTask";

    WorkflowTaskInstance taskInst = GenericWorkflowObjectFactory
        .getTaskObjectFromClassName(taskClass);
    assertNotNull(taskInst);
    assertEquals("The class: [" + taskInst.getClass().getName()
        + "] is not " + "equal to the expected class name: ["
        + taskClass + "]", taskClass, taskInst.getClass().getName());
  }
View Full Code Here


            // task execution
            LOG.log(Level.FINEST,
                    "IterativeWorkflowProcessorThread: Executing task: "
                            + task.getTaskName());

            WorkflowTaskInstance taskInstance = GenericWorkflowObjectFactory
                    .getTaskObjectFromClassName(task.getTaskInstanceClassName());
            // add the TaskId and the JobId and ProcessingNode
            // TODO: unfake the JobId
            workflowInst.getSharedContext().replaceMetadata(TASK_ID,
                    task.getTaskId());
View Full Code Here

   *         its class name.
   */
  public static WorkflowTaskInstance getTaskObjectFromClassName(String className) {

    if (className != null) {
      WorkflowTaskInstance taskInstance = null;

      try {
        Class workflowTaskClass = Class.forName(className);
        taskInstance = (WorkflowTaskInstance) workflowTaskClass.newInstance();

View Full Code Here

            // task execution
            LOG.log(Level.FINEST,
                    "IterativeWorkflowProcessorThread: Executing task: "
                            + task.getTaskName());

            WorkflowTaskInstance taskInstance = GenericWorkflowObjectFactory
                    .getTaskObjectFromClassName(task.getTaskInstanceClassName());
            // add the TaskId and the JobId and ProcessingNode
            // TODO: unfake the JobId
            workflowInst.getSharedContext().replaceMetadata(TASK_ID,
                    task.getTaskId());
View Full Code Here

      LOG.log(
          Level.FINEST,
          "IterativeWorkflowProcessorThread: Executing task: "
              + task.getTaskName());

      WorkflowTaskInstance taskInstance = GenericWorkflowObjectFactory
          .getTaskObjectFromClassName(task.getTaskInstanceClassName());
      // add the TaskId and the JobId and ProcessingNode
      // TODO: unfake the JobId
      workflowInst.getSharedContext()
          .replaceMetadata(TASK_ID, task.getTaskId());
View Full Code Here

      @Override
      public void run() {
        WorkflowLifecycle lifecycle = getLifecycle(taskProcessor);
        WorkflowTask workflowTask = getTaskFromProcessor(taskProcessor);
        WorkflowTaskInstance inst = GenericWorkflowObjectFactory
            .getTaskObjectFromClassName(workflowTask.getTaskInstanceClassName());
        try {
          inst.run(taskProcessor.getWorkflowInstance().getSharedContext(),
              workflowTask.getTaskConfig());
          String msg = "Task: [" + workflowTask.getTaskName()
              + "] for instance id: ["
              + taskProcessor.getWorkflowInstance().getId()
              + "] completed successfully";
View Full Code Here

   *         its class name.
   */
  public static WorkflowTaskInstance getTaskObjectFromClassName(String className) {

    if (className != null) {
      WorkflowTaskInstance taskInstance = null;

      try {
        Class workflowTaskClass = Class.forName(className);
        taskInstance = (WorkflowTaskInstance) workflowTaskClass.newInstance();

View Full Code Here

   *         its class name.
   */
  public static WorkflowTaskInstance getTaskObjectFromInnerClassName(Class<?> enclosingInstance, String className) {

    if (className != null) {
      WorkflowTaskInstance taskInstance = null;

      try {
        Class workflowTaskClass = Class.forName(className);
        Constructor construct = workflowTaskClass.getConstructor(enclosingInstance);
        taskInstance = (WorkflowTaskInstance) construct.newInstance();
View Full Code Here

      final Metadata dynMetadata) throws Exception {
    Thread worker = new Thread() {

      @Override
      public void run() {
        WorkflowTaskInstance inst = GenericWorkflowObjectFactory
            .getTaskObjectFromClassName(workflowTask.getTaskInstanceClassName());
        try {
          inst.run(dynMetadata, workflowTask.getTaskConfig());
        } catch (Exception e) {
          LOG.log(Level.WARNING,
              "Exception executing task: [" + workflowTask.getTaskName()
                  + "]: Message: " + e.getMessage());
          e.printStackTrace();
View Full Code Here

   * .cas.workflow.structs.WorkflowTask, org.apache.oodt.cas.metadata.Metadata)
   */
  @Override
  public void execute(WorkflowTask workflowTask, Metadata dynMetadata)
      throws Exception {
    WorkflowTaskInstance inst = GenericWorkflowObjectFactory
        .getTaskObjectFromClassName(workflowTask.getTaskInstanceClassName());
    try {
      LOG.log(Level.INFO, "Executing task: [" + workflowTask.getTaskName()
          + "] locally");
      inst.run(dynMetadata, workflowTask.getTaskConfig());
    } catch (Exception e) {
      LOG.log(Level.WARNING,
          "Exception executing task: [" + workflowTask.getTaskName()
              + "]: Message: " + e.getMessage());
      e.printStackTrace();
View Full Code Here

TOP

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

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.