RSS

Tag Archives: drools

Getting Started with Drools Workbench and Execution Server

Nowadays with version 7.5.0.Final as its latest release, getting started with Drools Workbench and Drools Execution Server is easier than any time in its history.

Drools Workbench is the authoring and management user interface that Drools provides. This allows to create Drools projects, author rules, processes, models, etc, manage and deploy servers, etc.

Drools Execution server are servers that can have rules deployed, and being feed and executed from other applications.

How to install them?

Both applications have showcase images in docker, so, getting them is just a matter of pulling the images:

docker pull jboss/drools-workbench-showcase

docker pull jboss/kie-server-showcase

Once this is done, latest version of both are pulled.

To run them, first, you need to start the workbench:

docker run -p 8080:8080 -p 8001:8001 -d –name drools-workbench jboss/drools-workbench-showcase:latest

and then, run one instance of the execution server, pointing to the drools workbench image:

docker run -p 8180:8080 -d –name kie-server –link drools-workbench:kie_wb jboss/kie-server-showcase:latest

And, that’s it!

Workbench will be running in the following link:

http://localhost:8080/drools-wb/

And log in with user admin/admin

Screenshot from 2017-12-24 21-09-02.png

And the execution server, here:

http://localhost:8180/kie-server/services/rest/server/

With credentials kieserver/kieserver1!

For more information about these docker images, you can check the following links:

https://hub.docker.com/r/jboss/drools-workbench-showcase/

https://hub.docker.com/r/jboss/kie-server-showcase/

Next time, we will explain, how to get started on using drools workbench to do authoring, and then deploying and running it in the execution server.

Advertisement
 
Leave a comment

Posted by on December 25, 2017 in Drools

 

Tags: , , ,

Drools and jBPM 6 Workshops @London

Hello World!

As many of you may know, the Drools team has been working hard for the 6 series of Drools and jBPM. They are comming with really nice new features that you can read in http://blog.athico.com/http://salaboy.com/ and related blogs. I will be taking about jBPM6 in this blog soon!

On October 23/24th, Mauricio Salatino (aka salaboy) and Michael Anstis will be talking about the new tooling and new stuff, in a free public session in London. The place will be sponsored by Plugtree, and it can be a nice opportunity to get in touch with first hand information on how it all looks like!

If you are wililng to attend, you can contact salaboy to reserve a sit. For more information, you can visit salaboy’s post about this.

http://salaboy.com/2013/10/04/drools-and-jbpm-6-workshops-2324-october-london/

Hope you can enjoy it!

Demian

 
Leave a comment

Posted by on October 4, 2013 in Drools

 

Tags: , ,

JBPM 5.1 in Tomcat 6

Hi everyone! I am back to the blog.
Recently I have done some work installing jbpm installer into tomcat again. It took me much less time that the first time :), but this time I decided to automate it, by patching the jbpm 5.1 full installer.First, let me review the steps I followed to deploy the jbpm installer tools in Tomcat 6:

1.
We need a JPA transaction manager to manage our jbpm runtime resources. So, let’s install Bitronix Transaction Manager in tomcat.
First, create btm-config.properties in tomcat.home/conf:
bitronix.tm.serverId=tomcat-btm-node0
bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog
bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties

2.
Create resources.properties in tomcat.home/conf, which will have the resources that the transaction manager will manage.
resource.ds1.className=org.h2.jdbcx.JdbcDataSource
resource.ds1.uniqueName=jdbc/testDS1
resource.ds1.minPoolSize=0
resource.ds1.maxPoolSize=5
resource.ds1.driverProperties.URL=jdbc:h2:tcp://localhost/~/test
resource.ds1.driverProperties.user=sa
resource.ds1.driverProperties.password=
resource.ds1.allowLocalTransactions=true

3.
In tomcat.home/conf/context.xml, add this line

WEB-INF/web.xml
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" />

4.
In tomcat.conf/conf/server.xml, add this line

<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener" />

5.
Create setenv.sh (or setenv.bat if using windows), with the following:
CATALINA_OPTS=”-Dbtm.root=$CATALINA_HOME -Dbitronix.tm.configuration=$CATALINA_HOME/conf/btm-config.properties”This file will be executed by catalina.shwhen starting tomcat

6.
Copy the following jars to tomcat.home/lib
btm-2.1.2.jar
btm-tomcat55-lifecycle-2.1.2.jar
dom4j.jar
ejb3-persistence.jar
h2.jar
javassist.jar
jta-1.1.jar
slf4j-api-1.6.0.jar
slf4j-jdk14-1.6.0.jar
You can take (apart from the two btm jars) the jars from the jboss as installation from the installer.

7.Explode gwt console server, and add a file called context.xml in META-INF/ with the following:

<?xml version="1.0" encoding="UTF-8"?>
<Context>
 <!-- Default set of monitored resources -->
 <WatchedResource>WEB-INF/web.xml</WatchedResource>

<Resource name="jdbc/testDS1" auth="Container" type="javax.sql.DataSource"
 factory="bitronix.tm.resource.ResourceObjectFactory" uniqueName="jdbc/testDS1" />
</Context>

8.
Modify web.xml in gwt console server, adding the following:

<resource-env-ref>
 <resource-env-ref-name>jdbc/testDS1</resource-env-ref-name>
 <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
</resource-env-ref>

9.
Modify WEB-INF/classes/META-INF/persistence.xml in gwt console server to look like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="1.0"
 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
 http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
 http://java.sun.com/xml/ns/persistence/orm
 http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
 xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://java.sun.com/xml/ns/persistence">

<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
 <provider>org.hibernate.ejb.HibernatePersistence</provider>
 <jta-data-source>java:comp/env/jdbc/testDS1</jta-data-source>
 <mapping-file>META-INF/JBPMorm.xml</mapping-file>
 <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
 <class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class>
 <class>org.drools.persistence.info.SessionInfo</class>
 <class>org.drools.persistence.info.WorkItemInfo</class>
 <class>org.jbpm.process.audit.ProcessInstanceLog</class>
 <class>org.jbpm.process.audit.NodeInstanceLog</class>
 <class>org.jbpm.process.audit.VariableInstanceLog</class>
 <properties>
 <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
 <property name="hibernate.max_fetch_depth" value="3"/>
 <property name="hibernate.hbm2ddl.auto" value="create" />
 <property name="hibernate.show_sql" value="false" />
 <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
 </properties>
 </persistence-unit>

</persistence>

10.
Add the following jars (taken from jboss as lib) to WEB-INF/lib in gwt console server:
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-core.jar
hibernate-entitymanager.jar

11.
Now, in exploded designer war, add the following jars (taken from jboss as lib) to WEB-INF/lib
antlr.jar
log4j-boot.jar

12.
Put the exploded wars in tomcat.home/webapps

13.
Start tomcat!
I have developed a patched version of installer to make it all for you:

https://rapidshare.com/files/3915421953/jbpm5.1.tomcat6.rar
Steps:

Hope this helps you!

Demian

PS: I will give 5.2 a try this week and update instructions if necessary!

 
3 Comments

Posted by on December 12, 2011 in Drools

 

Tags: , , , , ,

Drools and jBPM5 Open Training @London – August 8th/9th

Hi everyone,

Plugtree is going to organize an open training session, that will focus in Drools Expert and jBPM5, and also covering Drools Fusion. It is open to everyone who wants to learn about these projects, no matter if you have previous experience using them or not, as will it cover these technologies essential concepts as well as best practices and project internals.

You can check esteban and salaboy posts for more details, and also the event registration page.

Enjoy!

Demian

 
Leave a comment

Posted by on July 18, 2011 in Drools

 

Tags: , , , , , , ,

Using Variables in JBPM5 Human Tasks

I have been playing a bit with processes and human tasks, and I want to show how we can share variables between human tasks in Jbpm5.

Let’s see the following process:

There are three human tasks which may have input/output:

  • Write document: Should produce an output that should contain a document which will be used by the rest of the process.
  • Translate Document: Should take the “Write document” output to show to the user for reference, and produce an output that will contain the translated document.
  • Review Document: Should take the “Write document” output to show to the user for reference, and produce an output that will contain the review of this document.
First, let’s deal with the write document output.
In the .bpmn file, we will add a new item definition, which will define the structure and a name for this structure, and  then declare a variable inside our process:
Ok, now we should define the variable inside the “Write document” task, and bind it with this process property:
Results will be the name of the variable inside the task.
– In dataOutputAssociation we put the value of the Results to the approval.document variable.
Now, let’s use this variable as an input of “Translate Document”. We will use the already filled approval.document variable, and declare it as a parameter for the task.
Please note for the input variable, I used “Content” name variable. If you see the workitem for human tasks in jbpm5, its takes some predefined parameters and sends them to the task server, so the input information should be put in Content input. Edit: after a salaboy commit some time ago, now, the input of the task will be get from the “content” variable. If you want to send many separate variables, you can omit (send it blank) the content variable, and add other variables. If the human task work item handler  does not find anything in content variable, it will send a map with all the task variables as input.
The complete process definition can be found here:
Now, how can I use it from my human task?
To get the input, using the TaskClient and having the TaskSummary is possible:
To send the output:
The full example can be found in my examples github repository:
That’s all for now. Hope it helps.
Thanks for reading!
Demian
 
5 Comments

Posted by on May 6, 2011 in Drools, JBPM

 

Tags: , ,