M
M
MaxLich2018-11-15 17:30:55
Java
MaxLich, 2018-11-15 17:30:55

Why do I get errors if a service task or a script task (Alfresco's Activiti 6) comes after the timer in the bpm scheme?

Question about Alfresco's Activiti 6. If I put a block after the timer ( or ) in the scheme , then intermediate timer catching eventerrors will appear, and the process will not go any further. If there is a block , then this error occurs:boundary timer eventservice taskscript taskservice task

couldn't instantiate <full_class_name>

where <полное_имя_класса>is the class name specified for the block service taskin the class.
If script tasksomething like this:
Can't find scripting engine for 'groovy'

At the same time, there is a class for service taskin classpath, and the library for the engine groovyis also connected. The most interesting thing is that these errors do not always appear, and in 1 out of 5-10 cases everything works. Didn't find a rule.
PS I tried to work with timers both service taskin my working project (with RESTand Spring Web Mvc), and in a simple test application written in Swing. Errors occur here and there.
To describe in detail, the following was tried to solve this problem:
  • In the test application:
    - the class is placed in the src/main/java directory
    WEB-INF.classes.<пакеты_класса>.<короткое_имя_класса>
    (moreover, in the file of the class itself, packageit was written in <пакеты_класса>) - it did not help
    - a directory WEB-INF/classes/<пакеты_класса>with compiled classes inside was placed in the src/main/java directory (and packageit was also written in the file of the class itself <пакеты_класса>) - did not help
  • in the working project, src/main/javaa class was added to the directory <пакеты_класса>. <короткое_имя_класса>(moreover, packageit was written in the file of the class itself <пакеты_класса>) - it did not help

At the same time, in the final archive with the application ( jaror warthe class was in the directory WEB-INF/classes/<пакеты_класса>). At the same time, in the working project, in dependencies (and, therefore, in the directory WEB-INF/libor in the libserver directory Tomcat), there was a jar with this class located in the right package, and this also did not help.
ZY An example of my test process definition:
spoiler
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
  <process id="MaxShulTest_v20" name="MaxShulTest" isExecutable="true">
    <documentation>test process</documentation>
    <startEvent id="startEvent1"></startEvent>
    <userTask id="Task1" name="Task1"></userTask>
    <userTask id="Task4" name="Task4"></userTask>
    <userTask id="Task2" name="Task2"></userTask>
    <sequenceFlow id="sid-FEBA8018-5838-4AF2-8AE5-DED45EF36229" sourceRef="Task1" targetRef="Task2"></sequenceFlow>
    <sequenceFlow id="sid-A71A6EB8-293E-4EA7-A876-670C8E4ABF7C" sourceRef="Task2" targetRef="ExclusiveGateway1"></sequenceFlow>
    <sequenceFlow id="sid-1691D37B-9B00-452F-B031-124B3845912B" sourceRef="Task4" targetRef="ExclusiveGateway1"></sequenceFlow>
    <endEvent id="endEvent1"></endEvent>
    <sequenceFlow id="sid-EAC37DEB-9666-407E-8EE0-27C11CEC4302" sourceRef="ExclusiveGateway1" targetRef="endEvent1"></sequenceFlow>
    <exclusiveGateway id="ExclusiveGateway1"></exclusiveGateway>
    <boundaryEvent id="boundary_timer1" attachedToRef="Task1" cancelActivity="true">
      <timerEventDefinition>
        <timeDuration>PT1M</timeDuration>
      </timerEventDefinition>
    </boundaryEvent>
    <sequenceFlow id="sid-88CC1D13-0907-44CC-ACAE-6E2FC01C8A3F" sourceRef="startEvent1" targetRef="service_task_1"></sequenceFlow>
    <serviceTask id="service_task_1" name="service_task_1" activiti:class="ru.maxlich.app.test.activiti.model.service.LogDelegateService"></serviceTask>
    <sequenceFlow id="sid-B9705ABC-78B3-460A-80ED-613EE3147491" sourceRef="service_task_2" targetRef="Task1"></sequenceFlow>
    <intermediateCatchEvent id="timer_1" name="timer_1">
      <timerEventDefinition>
        <timeDuration>PT3M</timeDuration>
      </timerEventDefinition>
    </intermediateCatchEvent>
    <sequenceFlow id="sid-49554231-BC08-4237-8B48-6D5484289319" sourceRef="service_task_1" targetRef="timer_1"></sequenceFlow>
    <sequenceFlow id="sid-7C4E0E46-E680-45F2-847F-8C37FFB16C53" sourceRef="timer_1" targetRef="service_task_2"></sequenceFlow>
    <serviceTask id="service_task_2" name="service_task_2" activiti:class="ru.maxlich.app.test.activiti.model.service.LogDelegateService"></serviceTask>
    <sequenceFlow id="sid-727BA009-3FE2-48DE-B41E-693FCE3D2F53" sourceRef="boundary_timer1" targetRef="service_task_3"></sequenceFlow>
    <serviceTask id="service_task_3" name="service_task_3" activiti:class="ru.maxlich.app.test.activiti.model.service.LogDelegateService"></serviceTask>
    <sequenceFlow id="sid-7F9D801A-5C8F-4623-987E-2E3FC936126E" sourceRef="service_task_3" targetRef="Task4"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_MaxShulTest_v20">
 //остальные xml-теги
  </bpmndi:BPMNDiagram>
</definitions>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MaxLich, 2018-11-19
@MaxLich

Found the cause of the error. In parallel, Activiti Modeler was launched, which used the same base. I stopped this application and everything started working without errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question