Creating WorkItem Handler and adding as dependency For JBPM
Posted By : Mohit Shakya | 31-Jan-2018
Today I'll brief you
Before
jBPM is a flexible Business Process Management (BPM) suite. It's a bridge between business analysts and developers. Traditional BPM suites have an engine, which is limited to the attention of non-technical personnel. jBPM has two key points: the management functions manage business users and another is for developers. It is provided by RedHat Company.
Basically 'WorkItemHandler' is an interface in JBPM for task execution. It can be used as the dependency for
Using workItemHandler we can easily shift a whole java code workflow as an independent task.
package com.sample;
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemManager;
public class Test implements WorkItemHandler{
@Override
public void abortWorkItem(WorkItem arg0, WorkItemManager arg1) {
System.out.println("Aborting process...");
}
@Override
public void executeWorkItem(WorkItem arg0, WorkItemManager arg1) {
System.out.println("Executing process...");
}
}
To use above
- Create
jar of above workItemHandler Updload it in artifact repository of 'KIE-workbench'- Now, in your existing project just add this artifact as
dependancy . - Now, in your KIE-workbench add
declaration of this workItemHandler class in KIE knowledge base. - Now, add the declaration to WorkItemDefinition file and assign it a name.
- Now, this workItemHandler will be displayed in your BPM workflow as a task in right side
tool bar .
Now you can use this as a task in your workflow.
I hope
Thank You.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Mohit Shakya
Mohit has worked in groovy and grails, filesystems, ffmpeg. Mohit likes to be adventurous, likes music, solving puzzles, playing chess, and basketball.