cancel
Showing results for 
Search instead for 
Did you mean: 

Deplyoing Shell-ServiceTasks doesn't work

dcs1
Champ in-the-making
Champ in-the-making
Hello everybody,

i am not very familiar with activiti so it may be a stupid question. I have installed Activiti 5.13 on a centOs-machine which has a TomCat6 and a mysql-database. I have change the configuration to work with the mysql-database. All other configuration-files have default values.
My first scenario is very simple, but doesn't work. I have Start -> ServiceTask(Shell) -> End. I tried to create it in the BPM Modeler and with the Designer in Eclipse. The Import works, but when i want to deploy it, it always says
Create of BPMN XML failed
Errors while parsing: One of the attributes 'class','delegateExpression','type','operation', or 'expression is mandatory on serviceTask.|servicetask1|line 5|column 83'


This is my bpmn-file:
<c><?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:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="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/test">
  <process id="myProcess" name="My process" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <serviceTask id="servicetask1" name="Service Task" type="shell">
      <extensionElements>
         <activiti:field name="command" stringValue="cmd" /> 
         <activiti:field name="arg1" stringValue="/c" /> 
         <activiti:field name="arg2" stringValue="echo" /> 
         <activiti:field name="arg3" stringValue="EchoTest" /> 
         <activiti:field name="wait" stringValue="true" /> 
         <activiti:field name="outputVariable" stringValue="resultVar" /> 
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
    <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
      <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">
        <omgdc:Bounds height="55.0" width="105.0" x="550.0" y="230.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="470.0" y="240.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="710.0" y="240.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="505.0" y="257.0"></omgdi:waypoint>
        <omgdi:waypoint x="550.0" y="257.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="655.0" y="257.0"></omgdi:waypoint>
        <omgdi:waypoint x="710.0" y="257.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
</c>

I did a lot of search on the Guide and the net, but couldn't find any solution for my problem. I hope you can help me.

Regards
dcs
22 REPLIES 22

dcs1
Champ in-the-making
Champ in-the-making
Nonsense. Didn't see your post.

Edit:This means that here was nonsense written here, because i didn't see your post.
Please delete this post.

trademak
Star Contributor
Star Contributor
Hi,

This error says that your system was not able to execute the shell command. Is there a more detailed error message in the stacktrace?

Best regards,

dcs1
Champ in-the-making
Champ in-the-making
Hello trademak,
thank you for helping.
This is the only error i get. Is there any more detailed information at some "hidden" place? Or more a place i don't know?
It's a traceable and repeatable behaviour, so if i need to enable some logging-features i could do it.
Awaiting your answer.

Best Regards,
dcs

trademak
Star Contributor
Star Contributor
The stacktrace should also include the original error. Is the stacktrace not longer then what you included?

Best regards,

greglee
Champ in-the-making
Champ in-the-making
I also have exactly the same problem on two slightly different platforms. The problem being the error when deploying a shell task model ie
<code>Validation set: 'activiti-executable-process' | Problem: 'activiti-servicetask-missing-implementation'] : One of the attributes 'class', 'delegateExpression', 'type', 'operation', or 'expression' is mandatory on serviceTask.</code>

  1. Activiti 5.15.1 on CentOS release 5.9 (Final) 32bit, Oracle java version "1.7.0_25" 32bit, Apache Tomcat/7.0.39
  2. Activiti 5.16.4 on CentOS Linux release 7.1.1503 (Core) 64bit, Oracle Java 1.7.0_79-b15 amd64, Apache Tomcat/7.0.62
Can you suggest what I can do to assist debugging this.
Thanks in advance.

jbarrez
Star Contributor
Star Contributor
How does your BPMN XML look like? If I recall correcly, the 'type' should be 'shell' for a shell task.

greglee
Champ in-the-making
Champ in-the-making
The XML is
<code>
<?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"
  xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC"
  xmlnsSmiley Surprisedmgdi="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="testShellCommand" isExecutable="true">
    <startEvent id="sid-49CBD23F-8851-4CA8-9200-1B23FB88DD7A"></startEvent>
    <serviceTask id="sid-DDA62AA4-E636-4DF3-A112-46E52B3F3A72" name="echoShellCommand" activiti:type="shell">
      <extensionElements>
<activiti:field name="command" stringValue="echo" />
<activiti:field name="arg1" stringValue="EchoTest" />
<activiti:field name="outputVariable"  stringValue="resultVar" />
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="sid-DCD37D36-0503-4D6B-92F9-BF52706B3BE5"
      sourceRef="sid-49CBD23F-8851-4CA8-9200-1B23FB88DD7A"
      targetRef="sid-DDA62AA4-E636-4DF3-A112-46E52B3F3A72"></sequenceFlow>
    <endEvent id="sid-E53E8C9A-3B1E-459B-90BB-C50A2CC459CD"></endEvent>
    <sequenceFlow id="sid-087C19C2-0E19-4CD3-88CC-C27B1A7DEEDD"
      sourceRef="sid-DDA62AA4-E636-4DF3-A112-46E52B3F3A72"
      targetRef="sid-E53E8C9A-3B1E-459B-90BB-C50A2CC459CD"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_process">
    <bpmndi:BPMNPlane bpmnElement="process" id="BPMNPlane_process">
      <bpmndi:BPMNShape bpmnElement="sid-49CBD23F-8851-4CA8-9200-1B23FB88DD7A"
        id="BPMNShape_sid-49CBD23F-8851-4CA8-9200-1B23FB88DD7A">
        <omgdc:Bounds height="30.0" width="30.0" x="22.0" y="76.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-DDA62AA4-E636-4DF3-A112-46E52B3F3A72"
        id="BPMNShape_sid-DDA62AA4-E636-4DF3-A112-46E52B3F3A72">
        <omgdc:Bounds height="80.0" width="100.0" x="135.0" y="51.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-E53E8C9A-3B1E-459B-90BB-C50A2CC459CD"
        id="BPMNShape_sid-E53E8C9A-3B1E-459B-90BB-C50A2CC459CD">
        <omgdc:Bounds height="28.0" width="28.0" x="280.0" y="77.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sid-087C19C2-0E19-4CD3-88CC-C27B1A7DEEDD"
        id="BPMNEdge_sid-087C19C2-0E19-4CD3-88CC-C27B1A7DEEDD">
        <omgdi:waypoint x="235.0" y="91.0"></omgdi:waypoint>
        <omgdi:waypoint x="280.0" y="91.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-DCD37D36-0503-4D6B-92F9-BF52706B3BE5"
        id="BPMNEdge_sid-DCD37D36-0503-4D6B-92F9-BF52706B3BE5">
        <omgdi:waypoint x="52.0" y="91.0"></omgdi:waypoint>
        <omgdi:waypoint x="135.0" y="91.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
</code>

Just tried it on 5.17 (upgraded the 5.16 machine of the last post)
Imports fine thru Processes|Model Workspace|Import
But when I select Model Action: Deploy it fails with:
<code>
09:38:02,244 [ajp-bio-8009-exec-7] ERROR org.activiti.editor.ui.EditorProcessDefinitionDetailPanel  - Failed to deploy model
org.activiti.engine.ActivitiException: Errors while parsing:
[Validation set: 'activiti-executable-process' | Problem: 'activiti-servicetask-missing-implementation'] : One of the attributes 'class', 'delegateExpression', 'type', 'operation', or 'expression' is mandatory on serviceTask. - [Extra info : processDefinitionId = testShellCommand | id = sid-DDA62AA4-E636-4DF3-A112-46E52B3F3A72 |  | activityName = echoShellCommand | ] ( line: 5, column: 88)

        at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:215)
        at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:112)
        at org.activiti.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:50)
        at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:103)
        at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:37)
        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.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
        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.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:78)
        at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:156)
        at org.activiti.editor.ui.EditorProcessDefinitionDetailPanel.deployModelerModel(EditorProcessDefinitionDetailPanel.java:346)
        at org.activiti.editor.ui.EditorProcessDefinitionDetailPanel.deployModel(EditorProcessDefinitionDetailPanel.java:276)
        at org.activiti.editor.ui.EditorProcessDefinitionDetailPanel$1.valueChange(EditorProcessDefinitionDetailPanel.java:162)
        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 com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
        at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
        at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
        at com.vaadin.ui.AbstractField.fireValueChange(AbstractField.java:897)
        at com.vaadin.ui.AbstractField.setValue(AbstractField.java:529)
        at com.vaadin.ui.AbstractSelect.setValue(AbstractSelect.java:676)
        at com.vaadin.ui.Select.changeVariables(Select.java:664)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
        at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:325)
        at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.activiti.explorer.filter.ExplorerFilter.doFilter(ExplorerFilter.java:42)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
</code>

Am keen to get this working
Thanks

jbarrez
Star Contributor
Star Contributor
Ok, now i see it: i missed originally that this was in Explorer, not the engine (which i checked and verified).
The shell task is currently not supported in the import/export (it's also not in the palette of the modeler).
One workaround could be to make your own ServiceTask java class, make it extend from the ShellTaskBehaviour.
Then instead of the activiti:type, you use the activiti:class="com.company.YourClass".

Hi,

I search this class 'ShellTaskBehaviour' but dont get it.

Could you please let me know in which package this class belongs, actually I am working 5.0.18 version of Activiti.

My requirement is I have a shell script and what to execute it through Activiti.

I shall be thankful if you provide me the solution for this.

Thanks
Mohit

greglee
Champ in-the-making
Champ in-the-making
Ok, thanks for that.
I can confirm that deploying via the REST api works and that once deployed it can be started via explorer or REST.
It would be "nice" if explorer and designer could handle it but we have a workaround 🙂