Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-592

TaskInstance::startTime always returns null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • jBPM 3.1.0
    • Runtime Engine
    • None
    • Low

    Description

      Method TaskInstance::getStart always returns null. As I can see - it is because nulls are stored into start_ column in jbpm_taskinstance table - seems some problem in task creation.

      Here is test case for demonstating the problem:

      package com.sample;

      import java.util.Date;
      import java.util.List;

      import org.jbpm.db.AbstractDbTestCase;
      import org.jbpm.graph.def.ProcessDefinition;
      import org.jbpm.graph.exe.ExecutionContext;
      import org.jbpm.graph.exe.ProcessInstance;
      import org.jbpm.taskmgmt.def.AssignmentHandler;
      import org.jbpm.taskmgmt.exe.Assignable;
      import org.jbpm.taskmgmt.exe.TaskInstance;

      public class TaskStartTimeTestCase extends AbstractDbTestCase {

      public static class JohnAssignmentHandler implements AssignmentHandler {
      private static final long serialVersionUID = 1L;
      public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception

      { assignable.setActorId("john"); }

      }

      public void testTaskStartTime()

      { ProcessDefinition processDefinition = ProcessDefinition.parseXmlString( "<process-definition>" + " <start-state>" + " <transition to='work' />" + " </start-state>" + " <task-node name='work'>" + " <task name='feed the chickens'>" + " <assignment class='com.sample.ProcessTerminationTestCase$JohnAssignmentHandler' />" + " </task>" + " <task name='walk the dog'>" + " <assignment class='com.sample.ProcessTerminationTestCase$JohnAssignmentHandler' />" + " </task>" + " <task name='play with wife'>" + " <assignment class='com.sample.ProcessTerminationTestCase$JohnAssignmentHandler' />" + " </task>" + " </task-node>" + "</process-definition>" ); graphSession.saveProcessDefinition(processDefinition); ProcessInstance processInstance = new ProcessInstance(processDefinition); processInstance.signal(); jbpmContext.save(processInstance); newTransaction(); List taskInstances = taskMgmtSession.findTaskInstances("john"); assertNotNull(taskInstances); assertEquals(3, taskInstances.size()); // get first task TaskInstance task = (TaskInstance)taskInstances.get(0); assertNotNull(task); // now, check the start time for the task and process: Date processStart = processInstance.getStart(); assertNotNull("Start time for the process should not be null", processStart); Date taskStart = task.getStart(); assertNotNull("Start time for the task should not be null", taskStart); }

      }

      Attachments

        Activity

          People

            tom.baeyens Tom Baeyens (Inactive)
            akakunin_jira Alexey Kakunin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: