Imixs-Workflow an Eclipse Microprofile

With the upcomming version 5.0.0 the Imixs-Workflow engine is integrated into the Eclipse Micoroprofile API.

The Enterprise Java technology has evolved with the industry for nearly two decades to support distributed application architectures based on RMI/IIOP, Web Services, and REST. The MicroProfile is the next step in that evolution. Since Imixs based on Java Enterprise technology stack, it is consistently to expand the technology to the new standard. As a developer this will bring you more features and a much smarter way to run the Imixs-Worklfow engine within a microservice architecture.

The Version 5.0.0 will provide the following APIs:

  • Metrics – This allows you to monitor Imixs-Workflow with Tools like Prometheus or Grafana
  • Health Check – The Health Check API can be used to probe the state of an Imixs-Worklfow instance from another machine (i.e. a kubernetes service controller)
  • Config API – Configuration data can now come from different locations

We will provide soon more documentation and examples on how you can run Imixs-Workflow in a Microservice Infrastructure. If you have questions please joint our community!

Hexagonal Architecture in Imixs-Workflow

The hexagonal architecture is a design pattern introduced by Dr. Alistair Cockburn.
A hexagon is a closed body and according to his pattern, an application is assumed to be a hexagon. Whatever is relevant to the business logic of an application gets to reside inside the hexagon and the rest is arranged outside. In this way, the business logic can be easily tested without worrying too much about external factors. So and this matches perfectly into the world of microservices.

Continue reading “Hexagonal Architecture in Imixs-Workflow”

BPM with Apache Kafka

The Imixs-Workflow project supports now a native integration Adapter for Apache Kafka. With this feature asynchronous messages can be handled within a complex business process.

Apache Kafka is a distributed streaming platform. This means you can publish and subscribe to streams of records, similar to a message queue or an enterprise messaging system. Apache Kafka store streams of records in a fault-tolerant durable way and process streams of records as they occur.
Kafka is generally used for two broad classes of applications:

  • Building real-time streaming data pipelines that reliably get data between systems or applications
  • Building real-time streaming applications that transform or react to the streams of data

The Imixs-Kafka Adapter integrates Kafka in a native way and allows the producing and consuming of Imixs-Workflow Messages.

Workflow Message Autowire

With Imixs-Kafka you can easily setup a scenario where Workflow Messages are generated automatically during the processing life-cycle. With the Autowire-Function new process instances are send into a Kafka Message Queue so that any consumer interested in workflow events can consume the message and react in various ways.

The Adapter filters Workflow events by the Model Version number so you can control which kind of workflows are send into a message queue.

Workflow Messages based on Business Logic

Another way to send Workflow Messages into a Kafka queue is the Imixs-Adapter Class. This implementation is based on the Imixs-Adapter concept and allows a more fine grained modeling of an asynchronous service integration. The Imixs-Kafka Adapter can be configured directly in a BPMN 2.0 Model.

This modeling approach allows you to setup complex workflow scenarios with a asynchronous communication.

Sending Workflow Events With Kafka

The other way to integrate Imixs-Workflow into a Kafka infrastructure is to send Workflow Messages to a Kafka queue to be processed by the Imixs-Workflow Instance. In this way a client sends a Process Instance with a predefined topic into a Kafka Message queue.

Imixs-Workflow will automatically consume those messages and process the workflow data. In this way messages can be used to trigger the event-based Imixs-Workflow engine. The following example shows how a client can send a workflow event for a named topic:

String json_workitem = "{\"item\":[ "
+ " {\"name\":\"type\",\"value\":{\"@type\":\"xs:string\",\"$\":\"workitem\"}}, "
+ " {\"name\":\"$modelversion\",\"value\":{\"@type\":\"xs:string\",\"$\":\"1.0.1\"}}, "
+ " {\"name\":\"$taskid\",\"value\":{\"@type\":\"xs:int\",\"$\":\"1000\"}}, "
+ " {\"name\":\"$eventid\",\"value\":{\"@type\":\"xs:int\",\"$\":\"10\"}}, "
+ " {\"name\":\"txtname\",\"value\":{\"@type\":\"xs:string\",\"$\":\"test-json\"}}"
+ " ]}";
ProducerRecord<Long, String> record = new ProducerRecord<Long, String>("IN-1.0.1", json_workitem);

Microservices with Kafka and Imixs-Workflow

The Imixs-Kafka Adapter is a powerful feature to integrate Imixs-Workflow in a Microservice Infrastructure based on Publish-Subscribe Messaging Queues. With Apache Kafka a fault-tolerant and scalable messaging platform can be adapted to Saga Transactions based on a BPMN 2.0 model.

If you have any questions or your need help to integrate Imixs-Workflow into your Microservice Architecture you can join the project on Github.

Imixs-Workflow 4.5 Released

Today we released the new Version 4.5.0 of Imixs-Workflow. The version now has a full support of Java EE7. The release also includes also several improvements in JSF components and The Rest-API. Here is an overview about the latest changes:

New Features

  • The XMLItem now supports mixed value lists
  • New Extend FileData Object with custom attributes
  • LuceneUpdateService – provides a new ItemAdapter class to improve the extension mechanism
  • Full Java EE7 Support
  • Performance improvements for the imixs-faces module
  • RestService supports now custom reports to open spread sheets

Enhancements

  • JobHandlerRebuildIndex – allows to overwrite the Block_Size and Time_out
  • MailPlugin – Performance improvements

Bugfixes

  • WorkflowKernel – fixed computeNext Task – conditional Events computed correctly after changed conditions

A data migration is not needed. Existing applications can switch directyl to 4.5. Only JSF modules should adapt the new JSF Controllers. You can find details here.

Simulating Workflows

With the new project Imixs-Mock  you can now simulate your Imixs-Workflow BPMN models in an easy way. The project provides a full mock of the Imixs-Workflow engine and allows to test and simulate different workflow scenarios. Imixs-Mock simulates the full processing life-cycle including all workflow plug-ins. You can specify also a subset of plug-ins to test specific business logic in your workflow project.

To add the mock into your own workflow project just add the following dependencies:

<dependency>
  <groupId>org.imixs.workflow</groupId>
  <artifactId>imixs-mock</artifactId>
  <version>4.4.0</version>
  <scope>test</scope>
</dependency>
<!-- JUnit Tests -->
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.8.1</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.mockito</groupId>
  <artifactId>mockito-all</artifactId>
  <version>1.9.5</version>
  <scope>test</scope>
</dependency>

Now you can write your jUnit test class to verify your BPMN model. See the following example code:

@Test 
public void testSimple() {
  workitem = new ItemCollection();
  workitem.model("ticket-workflow-1.0").task(1000).event(10);
  workitem.replaceItemValue("_subject", "Hello World");
  try {
    workitem = workflowMockEnvironment.getWorkflowService().processWorkItem(workitem);
    Assert.assertNotNull(workitem);
    Assert.assertEquals(1100, workitem.getTaskID());
    Assert.assertEquals("manfred", workitem.getItemValue("namowner", String.class));
  } catch (AccessDeniedException | ProcessingErrorException | PluginException | ModelException e) {
    e.printStackTrace();
    Assert.fail();
  }
}

The Imixs-Mock allows you to simulate different users processing a process instance. In this way you can verify the Access Control List (ACL) of a process instance and the assignment of process owners in complex workflow scenarios.

You will find the full example on Github.

Imixs-Workflow – Support of Nashorn JavaScript Engine

With the next release of Imixs-Workflow (3.6.0) the open source workflow engine will support JDK 8 and the new JavaScript Engine Nashorn. The JavaScript engine supports the ECMAScript 5.1 specification. This allows to use new features when executing scripts from the Imixs RulePlugin. The Imixs RulePlugin is part of the workflow engine and allows the execution of business rules defined in a BPMN model. You can find more about the Imixs RuleEngine here. Read also the Rhino Mogration Guide for more details about the new capabilities of the Nashorn Script Engine included in JDK 8.

Merry Christmas – Imixs-Workflow Version 3.5.0 Released

Today – just before Christmas 😉 – we published the latest version of the open source workflow engine ‘Imixs-Workflow’.

bpmn_example_06The new release includes an improved BPMN parser. The new parser supports BPMN 2.0 link events and also shared events. Shared events can be used to reduce the complexity of large BPMN models. Examples about the new BPMN 2.0 modelling capabilities can be found here.
Also the Imixs-Rest API was improved within this release. The internal JSON parser becomes more robust in parsing native JSON values which makes the usage easier for cross-platform environments.
Finally the Imixs RulePlugin includes a nice improvement: the RulePlugin can now evaluate the object ‘nextTask’, which can be used to evaluate complex business rules with decision maps.

The latest release is available in the maven central repository and the work on the next release 3.6.0 has already begun.

 

The Imixs project wishes all members of the community Merry Christmas!

 * * *

HOW TO CHANGE THE MYSQL DATABASE ENGINE

When you are running Imixs Workflow on a Linux Server using MySQL the database default engine is typically ‘MyISAM’. This is a fast engine type.

But for transactional systems it is recommended to use a database engine which is supporting transactions. This database engine in MySQL is called ‘InnoDB’. When you change the default engine type in your MySQL setup an new Imixs Workflow instance will create tables based on this engine type. But you can also simply change the engine type from ‘MyISAM’ to ‘InnoDB’ with a sql script:

ALTER TABLE `CALENDARITEM` ENGINE = InnoDB;
ALTER TABLE `DOUBLEITEM` ENGINE = InnoDB;
ALTER TABLE `ENTITY` ENGINE = InnoDB;
ALTER TABLE `ENTITYINDEX` ENGINE = InnoDB;
ALTER TABLE `ENTITY_CALENDARITEM` ENGINE = InnoDB;
ALTER TABLE `ENTITY_DOUBLEITEM` ENGINE = InnoDB;
ALTER TABLE `ENTITY_INTEGERITEM` ENGINE = InnoDB;
ALTER TABLE `ENTITY_READACCESS` ENGINE = InnoDB;
ALTER TABLE `ENTITY_READACCESSENTITY` ENGINE = InnoDB;
ALTER TABLE `ENTITY_TEXTITEM` ENGINE = InnoDB;
ALTER TABLE `ENTITY_WRITEACCESS` ENGINE = InnoDB;
ALTER TABLE `ENTITY_WRITEACCESSENTITY` ENGINE = InnoDB;
ALTER TABLE `INTEGERITEM` ENGINE = InnoDB;
ALTER TABLE `READACCESS` ENGINE = InnoDB;
ALTER TABLE `READACCESSENTITY` ENGINE = InnoDB;
ALTER TABLE `TEXTITEM` ENGINE = InnoDB;
ALTER TABLE `WRITEACCESS` ENGINE = InnoDB;
ALTER TABLE `WRITEACCESSENTITY` ENGINE = InnoDB;

This sql script did not connect to a specific database. For this reason it is necessary that you connect fist to the database the changes should be assigend. To run the script you can use the mysql command line tool in the following way:

First save the script into a local script file (e.g ‘mysql_innodb_imixs’). This file will be called later from the mysql console.

Now connect into the mysql Server:

mysql -u root -p

next select the database where the engine should be changed:

mysql> connect mydatabase;

finally you can run the script with the following command (assuming the you have stored the script before into a file named ‘mysql_innodb_imixs’ which is located in the current directory) :

mysql> source  mysql_innodb_imixs;

Thats it. Now you tables will use the new Database engine ‘InnoDB’.

When you configure the JDBC Datapool connection from your Glassfish Server it is strongly recommended to use a ‘javax.sql.XADataSource’ connection. This DataSource type supports the transaction scope provided by the Imixs Workflow System.

NEW! IMIXS WORKFLOW PROJECT

I am proud to announce that we started the new Open Source Workflow Project Imixs-Workflow on dev.java.net. This project arise from the ix-workflow project we developed about for more than 3 years. But the new project is much more easy to use. We developed a bunch of simplifications in the Workflow API so the hole project is now much easier to integreate. I would be happy if you can give me some feedback to that project on the project home page.

I will provide a short video next time to show how easy it is building workflow applications based on the API.