AnsweredAssumed Answered

Can not See Task in Activiti Explorer

Question asked by tulipneo on Jun 6, 2013
Latest reply on Jun 10, 2013 by trademak
Hi List,
I m very new to Activiti.
I am trying to learn this through the manning book and i was going through the sample programs.
I executed successfully in chapter 1.
My code are as bellow.

public class BookOrderTest {   
   public void startBookOrder() {
      ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration()   
      RepositoryService repositoryService = processEngine.getRepositoryService();
      RuntimeService runtimeService = processEngine.getRuntimeService();
      IdentityService identityService = processEngine.getIdentityService();
      TaskService taskService = processEngine.getTaskService();
      // remove tasks already present
            List<Task> availableTaskList = taskService.createTaskQuery().taskName("Work on order").list();
            for (Task task : availableTaskList) {
            Map<String, Object> variableMap = new HashMap<String, Object>();
            variableMap.put("isbn", "123456");
            ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(
                  "bookorder", variableMap);            
            System.out.println("id " + processInstance.getId() + " " + processInstance.getProcessDefinitionId());            
            List<Task> taskList = taskService.createTaskQuery().taskName("Work on order").list();
            System.out.println("size"+ taskList.size());
            assertEquals(1, taskList.size());
            System.out.println("found task " + taskList.get(0).getName());

The output in Console are as bellow:(As expected):
validating order for isbn 123456
id 4 bookorder:1:3
found task Work on order

My xml file bookorder.bpmn20.xml structure is as bellow:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns=""
   <process id="bookorder" name="Order book">
      <startEvent id="startevent1" name="Start"/>
      <sequenceFlow id="sequenceflow1" name="Validate order" sourceRef="startevent1" targetRef="scripttask1"/>
      <scriptTask id="scripttask1" name="Validate order" scriptFormat="groovy">
            out:println "validating order for isbn " + isbn;
      <sequenceFlow id="sequenceflow2" name="Sending to sales" sourceRef="scripttask1" targetRef="usertask1"/>
      <userTask id="usertask1" name="Work on order">
         <documentation>book order user task</documentation>
      <sequenceFlow id="sequenceflow3" name="Ending process" sourceRef="usertask1" targetRef="endevent1"/>
      <endEvent id="endevent1" name="End"/>

From eclipse console i see the task is created but i dont see the task in Activiti Explorere.

Any help or advice is welcome
Thanks n Regards