[jboss-user] [jBPM Users] - Re: Implementing Escalation in jBPM 4.1

sebastian.s do-not-reply at jboss.com
Sat Sep 26 06:06:19 EDT 2009


I must be doing something wrong. I took the unit tests of the supplied examples as a base (regarding configuration files) which always worked fine for and I created my process and my tests. The problem is that an exception is thrown:


  | 12:03:47,093 FIN | [ProcessDefinitionImpl] creating new execution for process 'escalation'
  | 12:03:47,109 FIN | [DefaultIdGenerator] generated execution id escalation.1
  | 12:03:47,234 FIN | [ExecuteActivity] executing activity(start1)
  | 12:03:47,250 FIN | [DefaultIdGenerator] generated execution id escalation.1.timeout_task
  | 12:03:47,406 FIN | [ExecutionImpl] created execution[escalation.1.timeout_task]
  | 12:03:47,406 FIN | [ScopeInstanceImpl] creating timer on execution[escalation.1.timeout_task]
  | ### EXCEPTION ###########################################
  | 12:03:47,625 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd at 694f12
  | org.jbpm.api.JbpmException: no org.jbpm.pvm.internal.cal.BusinessCalendar in current environment
  | 


  | <process name="escalation" xmlns="http://jbpm.org/4.0/jpdl">
  |    <start g="174,36,48,48" name="start1">
  |       <transition g="-106,-24" name="to timeout_task" to="timeout_task"/>
  |    </start>
  |    <task assignee="alex" g="152,168,92,52" name="timeout_task">
  |       <transition g="-50,-21" name="timeout" to="escalated">
  |       	<timer duedate="5 seconds" /> 
  |       </transition>
  |       <transition g="-50,-21" name="to task2" to="task2"/>
  |    </task>
  |    <task assignee="mike" g="352,169,92,52" name="escalated">
  |       <transition g="-50,-21" name="to task2" to="task2"/>
  |    </task>
  |    <task assignee="peter" g="151,305,92,52" name="task2">
  |       <transition g="-48,-21" name="to end1" to="end1"/>
  |    </task>
  |    <end g="176,398,48,48" name="end1"/>   
  | </process>
  | 


  |  public void testTaskEscalaton() {
  |     ProcessInstance processInstance = executionService.startProcessInstanceByKey("escalation");
  |     String processInstanceId = processInstance.getId();
  |     processInstance = executionService.findProcessInstanceById(processInstanceId);
  |     
  |     List<Task> tasksAlex = taskService.findPersonalTasks("alex");
  |     
  |     if(tasksAlex.size() == 0) {
  |     	fail();
  |     }
  |     
  |     Job job = managementService.createJobQuery()
  |     .timers()
  |     .processInstanceId(processInstance.getId())
  |     .uniqueResult();
  |   
  |     managementService.executeJob(job.getId());
  |     processInstance = executionService.findProcessInstanceById(processInstance.getId());
  |     assertTrue(processInstance.isActive("escalated"));
  |     
  |     List<Task> tasksMike = taskService.findPersonalTasks("mike");
  |     if(tasksMike.size() == 0) {
  |     	fail();
  |     }
  |     
  |     tasksAlex = taskService.findPersonalTasks("alex");
  |     if(tasksAlex.size() == 1) {
  |     	taskService.completeTask(tasksAlex.get(0).getId());
  |     } else {
  |     	fail();
  |     }
  |     
  |   }
  | 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257169#4257169

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257169



More information about the jboss-user mailing list