2 Replies Latest reply on Oct 27, 2014 4:14 AM by mateuszadamiak

    [JBoss BRMS 5.3][jBPM 5.2] How can I add service task with work item handler

    mateuszadamiak

      Hi,

       

      What I want to do is to run the process through jBPM REST interface from my application and inside the process execute the logic from Java code inside my application.

       

      I have troubles with adding service task to the business process that would execute the Java code. I have found 3 resources in the internet where this topic is discussed [1][2][3], but they seem not to work in my case. The output is always the same - could not find work item handler for <Service task name>.

       

      [1] looks like a step by step guide. In my case I had some troubles with finding proper directories as we are using JBoss EAP in domain mode and deployed applications are in directories which names are created in runtime as some hash values. But nevertheless I have found these directories, I applied all the steps - creating configuration files, moving jar files and so on - still the outcome was that the work item handler could not be found. I made sure that the jar is in place, as in [2] this was the reason why it did not work.

       

      In [3] the registration of work item handler is through java code, but in my case it is not desired, as it would require changes in code each time new handler is added.

       

      Can someone guide me what should I do, to make service task work? I already lost my patience trying to fix this. I would be very greatful.

       

      Thanks,

      Mateusz.

       

      [1] - Example of simple process of executing a service task in JBPM Console.

      [2] - jBPM Console Server can't find WorkItem Handler Implementation

      [3] - https://access.redhat.com/documentation/en-US/JBoss_Enterprise_BRMS_Platform/5/html-single/BRMS_Business_Process_Managem…

        • 1. Re: [JBoss BRMS 5.3][jBPM 5.2] How can I add service task with work item handler
          swiderski.maciej

          since you're running in domain mode then access to war file is rather limited so you might want to copy files that are inside the war/WEB-INF/classes/META-INF/*.conf into home directory of the user that runs JBoss server and thee files should be discovered on restart and loaded. Next define your handlers in these files in home directory and that should give the possibility to use custom handlers. Though any change will require server restart.

           

          HTH

          1 of 1 people found this helpful
          • 2. Re: [JBoss BRMS 5.3][jBPM 5.2] How can I add service task with work item handler
            mateuszadamiak

            Ok, the problem was that in WorkItemDefinitions.conf I just pasted what was in [1] link and just append my handler. The file parser in jBPM couldn't resolve the second handler as the mapped class was not present on classpath and the parser stopped parsing there, so it did not get my handler mapping. I just left one line with my work item handler mapping and it worked. So the step by step guide in [1] is correct. Thanks Maciej for help though.