AnsweredAssumed Answered

different output from Test

Question asked by tomi87 on Jan 27, 2013
Latest reply on Feb 5, 2013 by tomi87
Hello,
can you explain me why the output for the following test is not in order like the tasks in my xml file?
and can you suggest me how I can get the output in the right order ?

In my xml file I have an userTask connection from "Verify monthly financial report1" to "Verify monthly financial report4".


My Test:

public class TenMinuteTutorial {
   @Rule
//   public ActivitiRule activitiRule = new ActivitiRule("activiti.cfg-mem.xml");

   @Test
   //@Deployment(resources={"FinancialReportProcess.bpmn20.xml"})
   public void startFormSubmit() {
      
      System.out.println("–Create Activiti process engine–");
        // Create Activiti process engine
       ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration() .buildProcessEngine();
       System.out.println("–Get Activiti services–");
       // Get Activiti services
       RepositoryService repositoryService = processEngine.getRepositoryService();
       RuntimeService runtimeService = processEngine.getRuntimeService();
       System.out.println("–Deploy the process definition–");
       // Deploy the process definition
       repositoryService.createDeployment().addClasspathResource("FinancialReport.bpmn20.xml").deploy();
       System.out.println("–Start a process instance–");
       // Start a process instance
       String procId = runtimeService.startProcessInstanceByKey("financialReport").getId();
       System.out.println("–Get the first task–");
       // Get the first task
       TaskService taskService = processEngine.getTaskService();

       List<Task> tasks = taskService.createTaskQuery().list();  

         int i=1;
       for (Task task : tasks) {
           System.out.println(task.getName()+" "+i);    
           i++;
            taskService.complete(task.getId());
          }   

       // verify that the process is actually finished
       HistoryService historyService = processEngine.getHistoryService();
       HistoricProcessInstance historicProcessInstance =
         historyService.createHistoricProcessInstanceQuery().processInstanceId(procId).singleResult();
       System.out.println("Process instance end time: " + historicProcessInstance.getEndTime());
   }
}

I get the following output for my test:

–Create Activiti process engine–
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Jan 27, 2013 3:04:37 PM org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
–Get Activiti services–
–Deploy the process definition–
Jan 27, 2013 3:04:37 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
–Start a process instance–
–Get the first task–
Verify monthly financial report1 1
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Verify monthly financial report3 2
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Verify monthly financial report2 3
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Verify monthly financial report1 4
Verify monthly financial report3 5
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource FinancialReport.bpmn20.xml
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 27, 2013 3:04:38 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='financialReport' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Process instance end time: null

In this output I have two times the "Verify monthly financial report1" Task. I'm confussed.
And sometimes the last output "Process instance end time: null" appears and sometimes not.

The XML file:
      <sequenceFlow id='flow1' sourceRef='theStart' targetRef='verifyReportTask1' />
      <userTask id="verifyReportTask1" name="Verify monthly financial report1"
         activiti:candidateGroups="student"></userTask>
      <sequenceFlow id='flow2' sourceRef='verifyReportTask1'
         targetRef='verifyReportTask2' />
      <userTask id="verifyReportTask2" name="Verify monthly financial report2"
         activiti:candidateGroups="student"></userTask>
      <sequenceFlow id='flow3' sourceRef='verifyReportTask2'
         targetRef='verifyReportTask3' />
      <userTask id="verifyReportTask3" name="Verify monthly financial report3"
         activiti:candidateGroups="student"></userTask>
      <sequenceFlow id='flow4' sourceRef='verifyReportTask3'
         targetRef='verifyReportTask4' />
      <userTask id="verifyReportTask4" name="Verify monthly financial report4"
         activiti:candidateGroups="student"></userTask>
      <sequenceFlow id='flow5' sourceRef='verifyReportTask4'
         targetRef='theEnd' />

Best regards

Outcomes