Pular para o conteúdo principal

Postagens

Mostrando postagens com o rótulo workitemhandler

Importing Work Item Handlers in jBPM using a custom service repository

We previously talked about creating a custom Work Item Handler and how to import it in the jBPM designer. The process is not simple, it requires some manual steps and it is error prone - even some users had problems as you can see in the post comment's section. jBPM 6.5 comes with a great new feature that makes easier to import services. In this post I will show you how to use this new feature. A very simple Work Item Handler Remember our hello world work item handler ? Let's clone it and install it on your local maven using mvn clean install Now create a directory on your installacation called repository. It should have a file with content "HelloWorld" and a child directory called HelloWorld. Inside this directory we should have a file named HelloWorld.wid with the following content: [   [     "name" : "HelloWorld",     "description" : "Prints hello World in the console",     "displayName" : "Hello ...

A jBPM 6 JPA Work Item Handler implementation

When we work with jBPM, we can already invoke REST and SOAP Web Services, send email without the need of writing a single line of Java code. You can simply drag and drop a component and configure it to perform the action. Using the REST Task from jBPM 6 Behind a component (tasks), we have a Work Item Handler(WIH): Creating custom Work Item Handler in BPM Suite/jBPM 6 A Parser work item handler for jbpm 6 In this post I will briefly talk about a work item handler I recently created to perform JPA(Java Persistence API) operations. Persistence and jBPM The jBPM process runs on a transaction. Once it reaches a safe point (start a subprocess, human task, timer and others), the transaction is commited. If we do operations that requires a transaction, it is important to these operations to be part of the running jBPM transaction. To persist process variables, we can use a  JPAPlaceholderResolverStrategy  and the process variables will be also persisted as part of the ...

A Parser work item handler for jbpm 6

One usual task we do in a process is to have to parse XML/JSON to objects and vice versa. I always look at sample work item handlers from jbpm and I want to create my own work item handlers because it is fun. Today I will quickly show the first public useful work item handler I have created: The parser. What is and how to use it? It is a simple parser task that you can use in your BPM Suite/ jbpm 6 process to parse from XML/JSON to some Java object and vice versa. You can, for example, read XML from a file and convert to your model object. It can be used with the REST Task for previous jbpm version, since recently support to transform was added to the REST Task .  It accepts the following parameters: Input: The input data. If you provide a string, the parser will try to parse the string to an object of type Type  and format Format  (see below), if not, it will try to parse the object to a String of format Format. It is a required parameter; Forma...

Creating custom Work Item Handler in BPM Suite/jBPM 6

Hi all! In this post I am going to share my experience creating a work item handler for BPM Suite 6.0.3 (which is very similar to jbpm as explained in a previous post ). The Hello World Work Item Handler Let's create a really simple WorkItemHandler just to print "Hello World" in the console. Of course you can implement more feature and make it receive parameters, access database, web services, etc. But in this post we will keep it simple. Really simple. First thing to do is to create a maven project for my WorkItemHandler. Here's the pom.xml of my Maven project: Notice that we are importing jbpm dependency so we can find the java interface that is used to create work item handlers. Now we can start coding. Let's create a class name HelloWorkItemHandler in package org.jugvale.jbpm, here is the simple code: Now we can build our project and go to BPM Suite to configure it so we can use this workitem. Registering the WorkItemHandler UPDATE...