AnsweredAssumed Answered

How to get taskId

Question asked by dmetallidis on Aug 13, 2016
Latest reply on Aug 13, 2016 by dmetallidis
hello,

I am unable to get the taskId as i get the error of :
<code>
org.activiti.engine.ActivitiObjectNotFoundException: No task found for taskId 'userTask1'
   at org.activiti.engine.impl.cmd.GetTaskFormCmd.execute(GetTaskFormCmd.java:45)
   at org.activiti.engine.impl.cmd.GetTaskFormCmd.execute(GetTaskFormCmd.java:31)
   at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
   at org.activiti.engine.impl.FormServiceImpl.getTaskFormData(FormServiceImpl.java:58)
   at org.activiti.designer.test.ProcessTestWorkflowMonitoringExecutionV1.startProcess(ProcessTestWorkflowMonitoringExecutionV1.java:68)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:606)
   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
   at org.activiti.engine.test.ActivitiRule$1.evaluate(ActivitiRule.java:126)
   at org.junit.rules.RunRules.evaluate(RunRules.java:20)
   at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
<code>
the unit test I am having is the below:

<code>
      ProcessDefinition definition = activitiRule.getRepositoryService()
      .createProcessDefinitionQuery().processDefinitionKey("workflowMonitoringExecution").singleResult();
      assertNotNull(definition);
         
      TaskService taskService = activitiRule.getTaskService();
      assertNotNull(taskService);
      
      FormService formService = activitiRule.getFormService();
      
      List<FormProperty> formList = formService.getStartFormData(definition.getId()).getFormProperties();
      assertEquals(1, formList.size());
      Map<String, String> formProperties = new HashMap<String, String>();
      formProperties.put("serviceName", "something");
      formService.submitStartFormData(definition.getId(), formProperties);
      
      long taskDefinition = activitiRule.getTaskService()
            .createTaskQuery().taskDefinitionKey("CheckServiceCatalogue").count();
      List<FormProperty> formTaskList = formService.getTaskFormData("userTask1").getFormProperties();
<code>

Variable of formTaskList returns null although i have defined user task with name userTask1.

Some help please.

Regards,
Dam

Outcomes