6 Replies Latest reply on Dec 16, 2014 8:26 AM by lauradp

    Problem with custom service tasks

    lauradp

      Hi,

      I have a problem with a custom service task:

      [

          "name" : "MyTask",

          "parameters" : [

        "ExtraParam1" : new StringDataType(),

        "ExtraParam2" : new StringDataType()

        "messageId" : new StringDataType()

          ],    "results" : [

              "MyTaskExitValue" : new IntegerDataType()

          ],

          "displayName" : "MyTask",

          "icon" : "defaultservicenodeicon.png"

        ],

      ]

       

      When trying to add my task to a process I get theerrors reported below.

       

      Can anyone help me?

       

      Laura

       

       

       

       

      15:55:12,315 ERROR [stderr] (http-<<host>>-<<host>>-8080-2) java.lang.IllegalArgumentException: No enum const class org.jbpm.designer.bpmn2.impl.Bpmn20Stencil.Task_Run

      15:55:12,330 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at java.lang.Enum.valueOf(Enum.java:196)

      15:55:12,337 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.bpmn2.impl.Bpmn20Stencil.valueOf(Bpmn20Stencil.java:35)

      15:55:12,347 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.bpmn2.impl.Bpmn20Stencil.createElement(Bpmn20Stencil.java:135)

      15:55:12,357 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.bpmn2.impl.Bpmn2JsonUnmarshaller.createBaseElement(Bpmn2JsonUnmarshaller.java:5352)

      15:55:12,369 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.bpmn2.impl.Bpmn2JsonUnmarshaller.unmarshallItem(Bpmn2JsonUnmarshaller.java:2001)

      15:55:12,381 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.bpmn2.impl.Bpmn2JsonUnmarshaller.unmarshallItem(Bpmn2JsonUnmarshaller.java:1926)

      15:55:12,392 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.bpmn2.impl.Bpmn2JsonUnmarshaller.unmarshall(Bpmn2JsonUnmarshaller.java:166)

      15:55:12,403 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.bpmn2.impl.Bpmn2JsonUnmarshaller.unmarshall(Bpmn2JsonUnmarshaller.java:136)

      15:55:12,415 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.web.profile.impl.JbpmProfileImpl$1.parseModel(JbpmProfileImpl.java:210)

      15:55:12,426 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.repository.servlet.AssetServiceServlet.doPost(AssetServiceServlet.java:103)

      15:55:12,437 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

      15:55:12,446 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

      15:55:12,455 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

      15:55:12,467 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      15:55:12,478 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)

      15:55:12,489 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

      15:55:12,501 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      15:55:12,512 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)

      15:55:12,523 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

      15:55:12,535 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      15:55:12,546 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)

      15:55:12,557 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

      15:55:12,578 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      15:55:12,589 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jbpm.designer.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:70)

      15:55:12,599 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

      15:55:12,611 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      15:55:12,622 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.uberfire.security.server.UberFireSecurityFilter.doFilter(UberFireSecurityFilter.java:266)

      15:55:12,633 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

      15:55:12,644 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      15:55:12,655 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

      15:55:12,665 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

      15:55:12,676 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397)

      15:55:12,686 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

      15:55:12,697 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

      15:55:12,709 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

      15:55:12,719 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      15:55:12,729 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:416)

      15:55:12,739 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      15:55:12,749 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

      15:55:12,759 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

      15:55:12,768 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

      15:55:12,780 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

      15:55:12,789 ERROR [stderr] (http-<<host>>-<<host>>-8080-2)       at java.lang.Thread.run(Thread.java:662)

      15:55:12,799 ERROR [org.jbpm.designer.repository.servlet.AssetServiceServlet] (http-<<host>>-<<host>>-8080-2) Error storing asset: No enum const class org.jbpm.designer.bpmn2.impl.Bpmn20Stencil.Task_MyTask

        • 1. Re: Problem with custom service tasks
          swiderski.maciej

          so you have added this to workitem definition file in given project and then tried to model your process that makes use of new service task, right? I'll give a try today with you definition and get back to you.

          • 2. Re: Problem with custom service tasks
            lauradp

            Thanks Maciej.

             

            I created a war containing:

            * custom workitem handlers classes;

            * MyCustomWorkItemHandlers.conf;

            * icons (even If I've not used them yet)

            then I added this jar to jbpm-console.war/WEB-INF/lib and updated jbpm-console.war\WEB-INF\classes\META-INF\drools.session.conf in this way:

             

            drools.workItemHandlers = CustomWorkItemHandlers.conf MyCustomWorkItemHandlers.conf

             

            Should I do anything else?

            • 3. Re: Problem with custom service tasks
              swiderski.maciej

              these steps looks alright. Though I would go simpler way and edit CustomWorkItemHandler.conf in jbpm-console.war/WEB-INF/classes/META-INF instead of editing drools.session.conf and including additional conf file in your custom jar.

               

              I checked the work item definition as well and looks like you have quite few typos there as it did not validate when used the one from your original post. Here is one that works just fine for me:

              [

                  "name" : "MyTask",

                  "parameters" : [

                "ExtraParam1" : new StringDataType(),

                "ExtraParam2" : new StringDataType(),

                "messageId" : new StringDataType()

                  ],  

              "results" : [

                      "MyTaskExitValue" : new IntegerDataType()

                  ],

                  "displayName" : "MyTask",

                  "icon" : "defaultservicenodeicon.png"

              ]

               

              HTH

              • 4. Re: Problem with custom service tasks
                lauradp

                Hi Maciej,

                I pasted your work definition into my WorkDefinitions, but I got the same error.

                 

                Laura

                • 5. Re: Problem with custom service tasks
                  lauradp

                  I solved this problem,

                  I added my workItemHandler package to process imports.

                   

                  Laura

                  • 6. Re: Problem with custom service tasks
                    lauradp

                    Hi,

                    I'm having this error again.

                     

                    How can I face it?

                     

                    Laura