How to execute a script task asynchronously ?

159 views
Skip to first unread message

slevoac...@gmail.com

unread,
Oct 17, 2013, 11:38:06 AM10/17/13
to camunda-...@googlegroups.com
I have the following scripttask that I want to be executed asynchronously:

<bmpmn2:scriptTask id="timerExpire" activity:async="true" name="Execute script" scriptFormat="js" >
<bmpmn2:incoming>SequenceFlow_3</bmpmn2:incoming>
<bmpmn2:script>if{
throw new java.lang.RuntimeException('Camunda Engine Rocks!');
}</bmpmn2:script>
</bmpmn2:scriptTask>

But when I am deploying it inside the camunda engine, I get the following error:

Error while closing command context: org.camunda.bpm.engine.ProcessEngineException: couldn't parse 'diagrams/timer_error_process.bpmn': The prefix "activiti" for attribute "activiti:async" associated with an element type "scriptTask" is not bound.
at org.camunda.bpm.engine.impl.util.xml.Parse.execute(Parse.java:133)
at org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:231)

Any ideas how to make the scripttask to execute asynchronously, and deploy correctly ?

Thanks and regards,

Roman Smirnov

unread,
Oct 21, 2013, 8:00:04 AM10/21/13
to camunda-...@googlegroups.com, slevoac...@gmail.com
Hi,

you need to add the namespace attribute for the prefix "activiti" inside the "definitions" element, in case of your snippet it should be:

<bmpmn2:definitions
  ...
 
xmlns:activiti="http://activiti.org/bpmn"
  ...
>

Then you should be able to deploy the BPMN 2.0 XML successfully.

I hope it helps you!

Cheers,
Roman
Reply all
Reply to author
Forward
0 new messages