Dependencies of a Work Item Handler

351 views
Skip to first unread message

Tyler Dalious

unread,
Jan 7, 2016, 1:41:24 PM1/7/16
to jBPM Usage
As a preface, I'm using KIE Workbench for jBPM 6.2.0.Final. Most of my info on this matter comes from either here (https://developer.jboss.org/message/905019#905019) or here (http://fxapps.blogspot.com/2015/04/creating-custom-work-item-handler-in.html) (honestly documentation that appeared more useful than "official" jbpm documentation).

I'm having an issue where I am not sure how to get 3rd party libraries (such as glassfish or apache--non native java) I want to use for my work item handlers included in my jbpm instance. My current method of making my own service tasks is as follows:

  1. Create work item handler
    1. Java project that imports WorkItem, WorkItemHandler, and WorkItemManager (implements WorkItemHandler)
    2. Compile into a jar
    3. Copy into /jbpm-installer/dependencies
  2. Add mapping to the CustomWorkItemHandlers.conf file
    1. /jbpm-installer/conf/META-INF/CustomWorkItemHandlers.conf
    2. "TaskName" : new <canonical path>.TaskNameWorkItemHandler(),
  3. Restart jbpm
    1.  ant stop.demo
    2. ant install.demo.noeclipse
    3.  ant start.demo.noeclipse
    4. (repopulate users.properties and roles.properties)
  4. Upload to artifact repo on KIE workbench
    1. Might be optional, but it works with it
  5. Add as dependency for project
    1. Project Editor -> drop down -> Dependencies
    2. Add (from repo would make sense from step 4)
  6. Edit knowledge session to include work item handler
    1. Name -> name of class
    2. Type -> {package name}.{name of class}
  7. Add definition to WorkDefinitions.wid in KIE Workbench
    1. Go to your project -> Work Definitions
    2. Follow guidelines:

[

"name" : "<taskname>",

"parameters" : [

"<param1>" : new <Datatype>DataType(),

"<param2>" : new <Datatype>DataType(),

"<param3>" : new <Datatype>DataType(),

],

"displayName" : "<taskname>",

"icon" : "icons/<iconname.ext>"

]



My pom.xml for my project is such:
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  2.     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  3.     <modelVersion>4.0.0</modelVersion>  
  4.     <groupId>com.company.jbpm.workitemhandler</groupId>  
  5.     <artifactId>jenkinsWIH</artifactId>  
  6.     <version>1.0</version>  
  7.     <name>jenkinsWIH</name>  
  8.   
  9.     <dependencies>  
  10.         <dependency>  
  11.             <groupId>org.jbpm</groupId>  
  12.             <artifactId>jbpm-flow</artifactId>  
  13.             <version>6.0.1.Final</version>  
  14.             <scope>provided</scope>  
  15.         </dependency>  
  16.         <dependency>  
  17.             <groupId>org.glassfish.jersey.core</groupId>  
  18.             <artifactId>jersey-client</artifactId>  
  19.             <version>2.22.1</version>  
  20.         </dependency>  
  21.         <dependency>  
  22.             <groupId>javax.ws.rs</groupId>  
  23.             <artifactId>javax.ws.rs-api</artifactId>  
  24.             <version>2.0.1</version>  
  25.         </dependency>  
  26.     </dependencies>  
  27. </project> 


The install goes fine, I can add my new service task to a process in the modeler just fine, but when I go to build it I get Verification warnings all over about everything I use from glassfish, not to mention when I actually run that process, when it gets to my work item handler and runs the code it fails because of noclassfound type errors (because the library isnt available at the time).


I must be missing something on how to set this up. Should I be adding my work item handler definition in the deployment descriptor of my project instead of using a knowledge session? I really would like to use other libraries and not find workarounds in pure native java for my service tasks.

-Tyler



Song Choe

unread,
Sep 9, 2019, 3:13:11 PM9/9/19
to jBPM Usage
Hi,

did you resolve the issue?

Tyler Dalious

unread,
Sep 9, 2019, 3:55:04 PM9/9/19
to Song Choe, jBPM Usage
Wow, a bit of a throwback. Sorry, I really don't know as my team has moved away from JBPM. I looked through what notes I had and there's no difference in the steps/pom.xml that I can see.
I either solved it without noting what I did or just didn't solve it at all, sorry! Hope you can find a solution!
-Tyler

----------------------------
Unisys
Systems Engineer, CSM
Phone - (717)446-9636
----------------------------


--
You received this message because you are subscribed to a topic in the Google Groups "jBPM Usage" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jbpm-usage/t_oSsguKSVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jbpm-usage+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/f2955d5f-d30c-4864-a191-90137ae223fd%40googlegroups.com.

Song Choe

unread,
Sep 9, 2019, 5:55:09 PM9/9/19
to jBPM Usage
Understood.  Thank  you sir.
To unsubscribe from this group and all its topics, send an email to jbpm-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages