Unable to find groovy script in runtime

900 views
Skip to first unread message

Ibrahim Cherri

unread,
Jan 17, 2016, 7:31:31 AM1/17/16
to camunda BPM users
Hello,

I am trying to invoke a groovy script using an execution listener as below. (I am using Tomcat Distribution 7.4.0-Final)

        <camunda:executionListener event="end">
          <camunda:script scriptFormat="groovy" resource="ProcessEnd.groovy" />
        </camunda:executionListener>

But I am getting this error in the Camunda task list when running the workflow

An error happend while submitting the task form : Cannot submit task form 8f99d020-bd0b-11e5-a050-c038965cce55: ENGINE-09024 Unable to find resource at path ProcessEnd.groovy

The ProcessEnd.groovy is under the /src/main/resources folder in my project and it is also copied under my application WEB-INF\classes folder

If I manualy copy the groovy script under the Camunda web application resources folder camunda\WEB-INF\classes the error does not occur.

Any ideas how to solve this?

Thanks,

Ibrahim

Christian Lipphardt

unread,
Jan 17, 2016, 3:40:04 PM1/17/16
to camunda BPM users
Hi Ibrahim,

Did you see the examples for Script Source at [1]? It seems you are missing the camunda namespace in front of the 'resource' attribute like 'camunda:resource'.
Could you please try that out?

Cheers,
Christian

Ibrahim Cherri

unread,
Jan 18, 2016, 4:48:25 AM1/18/16
to camunda BPM users
Thanks Christian,

This solved it!

I want to note that I created the Execution listener using the Camunda Modeler app, so I think it should have added the camunda namespace by default.

Regards,

Ibrahim

Christian Lipphardt

unread,
Jan 19, 2016, 11:18:11 AM1/19/16
to camunda BPM users
Hi Ibrahim,

Coming back to you because the hint I gave you was wrong. Actually, when you prefix the attribute with the camunda namespace, it won't be parsed anymore and is not executed. I validated that in a testcase. That's why there is no error message anymore.
So we still have to get to the source of the problem.
Could you please upload the stripped down sources of your test project or attach it here?
I need the processes.xml, the process itself and the ProcessApplication class.

Cheers,
Christian

Ibrahim Cherri

unread,
Jan 20, 2016, 7:53:54 AM1/20/16
to camunda BPM users
Hi Christian,

Below the requested info

ProcessApplication

package org.testApp.framework;


import org.camunda.bpm.application.ProcessApplication;
import org.camunda.bpm.application.impl.ServletProcessApplication;
@ProcessApplication("testApp Framework")
public class testAppFrameworkApplication extends ServletProcessApplication {


}


processes.xml

<?xml version="1.0" encoding="UTF-8"?>
<process-application

  <process-archive name="testApp">
    <process-engine>default</process-engine>
    <properties>
      <property name="isDeleteUponUndeploy">false</property>
      <property name="isScanForProcessDefinitions">true</property>
    </properties>
  </process-archive>

</process-application>

process

<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:camunda="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="_e4Kb0YbDEeWaX7WF3_S9HA" targetNamespace="http://activiti.org/bpmn" exporter="camunda modeler" exporterVersion="2.7.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
  <bpmn2:process id="DemoWF" name="DemoWF" isExecutable="true">
    <bpmn2:extensionElements>
    </bpmn2:extensionElements>
    <bpmn2:startEvent id="StartEvent_1" name="start">
      <bpmn2:extensionElements>
      </bpmn2:extensionElements>
      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:userTask id="UserTask_1" name="task" camunda:assignee="demo">
      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
    </bpmn2:userTask>
    <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="StartEvent_1" targetRef="UserTask_1" />
    <bpmn2:endEvent id="EndEvent_1" name="end">
      <bpmn2:extensionElements>
        <camunda:executionListener event="end">
          <camunda:script scriptFormat="groovy" resource="ProcessEnd.groovy" />
        </camunda:executionListener>
      </bpmn2:extensionElements>
      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="UserTask_1" targetRef="EndEvent_1" />
  </bpmn2:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DemoWF">
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="322" y="197" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="_BPMNShape_UserTask_2" bpmnElement="UserTask_1">
        <dc:Bounds x="408" y="175" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_2" targetElement="_BPMNShape_UserTask_2">
        <di:waypoint xsi:type="dc:Point" x="358" y="215" />
        <di:waypoint xsi:type="dc:Point" x="408" y="215" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="_BPMNShape_EndEvent_2" bpmnElement="EndEvent_1">
        <dc:Bounds x="558" y="197" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_UserTask_2" targetElement="_BPMNShape_EndEvent_2">
        <di:waypoint xsi:type="dc:Point" x="508" y="215" />
        <di:waypoint xsi:type="dc:Point" x="558" y="215" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>




Thanks,

Ibrahim

Ibrahim Cherri

unread,
Jan 28, 2016, 3:33:03 AM1/28/16
to camunda BPM users
I added "classpath://" to the groovy file resource path and now it seems to be working
Reply all
Reply to author
Forward
0 new messages