Understanding Service Tasks in Imixs-Workflow

A common question from users transitioning from task-centric engines (like Camunda) to Imixs-Workflow, is whether Imixs-Workflow supports Service Tasks—a common BPMN element used in workflow engines like Camunda. Let’s see how this works in Imixs-Workflow

First of all – you can add a service Task into your model. But this will not execute any code.

The answer to this lies in understanding Imixs’s event-driven architecture. Unlike BPMN engines that rely on embedded code in Service Tasks, Imixs executes custom logic through events by two core mechanisms:

1. Plugins: Reusable Workflow Logic

Plugins are Java classes triggered at the processing phases of the workflow lifecycle. They act like “global interceptors” for business logic.

Key Traits:

  • Extend org.imixs.workflow.Plugin or AbstractPlugin.
  • Running in each processing cycle
  • Modify workflow documents during processing.

A Plugin can be added into the Model Workflow definition and will be executed automatically in each processing cycle.

Example: Automatically calculate a discount in an order approval workflow:

(See Plugin API Docs for details.)

2. Adapters: Event-Driven Actions

Adapters (CDI observers) react to workflow events, similar to microservices listening to Kafka topics. They’re ideal for side effects (e.g., sending emails, logging).

Key Traits:

  • Support CDI / EJB / Transactional
  • Running on a specific Event
  • Decoupled from the core workflow (run asynchronously if needed).

Example:

Why This Approach?

  • Separation of Concerns: Business logic lives outside BPMN files.
  • Flexibility: Plugins/Adapters can be shared, tested, and versioned independently.
  • Scalability: Events integrate with Java EE/CDI, Kubernetes, or serverless.

Migration Tip for Camunda Users

Instead of embedding code in a Service Task:

  1. For document transformations: Use a Plugin.
  2. For side effects (APIs, notifications): Use an Adapter.

Explore Further:

Questions? Discuss in the Imixs Forum.

How to Build Good Workflow Applications

In this short tutorial I will explain a few basic design patterns helping you to build really good Business Process Management Systems based on Imixs-Workfow. For these patterns it does not matter if you build a app just with the Imixs-Workflow core engine or if you use Imixs-Office-Workflow. All patterns explain very basic concepts which will help you a lot in understanding to build and maintain your business application. So lets start!

Continue reading “How to Build Good Workflow Applications”

Payara Micro 5.201 – Setup a JDBCRealm

To setup a database realm (JDBCRealm) in Payara Micro is a little bit tricky because some settings have changed in the past and so there is no clear updated example. This blog post shows a configuration example for Payara 5.2 in combination with a data source based on the Workflow project Imixs-Office-Workflow.

<security-service activate-default-principal-to-role-mapping="true" jacc="simple"
   audit-enabled="true" default-realm="jdbcRealm">

<auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="admin-realm">
<property value="${com.sun.aas.instanceRoot}/config/admin-keyfile" name="file" />
<property value="fileRealm" name="jaas-context" />
</auth-realm>

<!-- Imixs file realm configuraiton START -->
<auth-realm classname="com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm" name="jdbcRealm">
<property name="jaas-context" value="jdbcRealm"></property>
<property name="encoding" value="Hex"></property>
<property name="password-column" value="password"></property>
<property name="datasource-jndi" value="jdbc/office"></property>
<property name="group-table" value="userid_usergroup"></property>
<property name="user-table" value="userid"></property>
<property name="group-name-column" value="group_id"></property>
<property name="group-table-user-name-column" value="id"></property>
<property name="digest-algorithm" value="SHA-256"></property>
<property name="user-name-column" value="id"></property>
</auth-realm>
<!-- Imixs file realm configuraiton END -->

....
<audit-module classname="com.sun.enterprise.security.ee.Audit" name="default">
<property name="auditOn" value="true" />
</audit-module>
.....
</security-service>

Take care about the property “group-table-user-name-column”. This property is new and specifies the column name for the userid within the group table.

Another important setting is the “default-realm” in the security-service tag. This property must be set to the name of the jdbcRealm (in my case “jdbcRealm”).

Enable Security Audit

To get more information what is happening during the authentication you can enable the security-service audit with the attribute

audit-enabled="true"

and the audit for the security module with the property ‘auditOn’

<audit-module classname="com.sun.enterprise.security.ee.Audit" name="default">
   <property name="auditOn" value="true" />
</audit-module>

Microservice Saga Pattern with Imixs-Workflow

In my last blog I explained the core concepts behind the Microservice Saga Pattern. In this blog I will address the problem from a more practical perspective by demonstrating how Imixs-Workflow can be used as a Saga Orchestrator within a Microservice architecture. First, I would like to give a brief review of the main concepts of the saga pattern. Later I show some implementation examples.

Continue reading “Microservice Saga Pattern with Imixs-Workflow”

Cloud Native and Business Transactions

Everyone is talking about cloud technologies and of course every modern project relies on a microservice architecture. A variety of technologies and methods contribute to the success of this architecture pattern. But what does cloud native actually mean for the business world? How do companies and organizations implement business processes successfully beyond the big technology promises?

The basic idea of a microservice architecture is to break down the technical requirements of a software system into the smallest possible and therefore manageable services. The advantage: services created in this way can be developed independently of each other with different technologies by different teams. At the same time, we see new methods and technologies to connect, monitor and scale these services.

But just looking at the technology does’t mean that software can be developed faster and better. I would therefore like to compare some of these methods and technologies from the microservice architecture with the requirements for the development of business applications.

Continue reading “Cloud Native and Business Transactions”

BPMN Rule Engine

With the latest version 5.1.0 the Imixs-Workflow project introduces a BPMN based Rule Engine.

The BPMN Rule Engine uses Conditional Events to evaluate a business rule. This is a powerful mechanism to describe rules in a BPMN model and evaluate a given workitem.

The BPMN Rule Engine provides an easy way to describe also complex business rules based on a visual model. The rules are evaluated as a chain of conditional events. The engine evaluates the data of a given workitem.

A single condition is defined in a conditional sequence flow. The conditional expression is based on JavaScript but other Script languages are also supported.

To initialize a BPMN Rule Engine a Imixs BPMN Model instance need to be loaded first.

bpmnRuleEngine=new BPMNRuleEngine(model);

workitem = new ItemCollection().model(MODEL_VERSION).task(100).event(10);
workitem.setItemValue("a", 1);
workitem.setItemValue("b", "DE");

// evaluate rule
Assert.assertEquals(200, bpmnRuleEngine.eval(workitem));

The model instance can either be taken from a running instance of the Imixs-Workflow engine or loaded on demand from the file system:

// load BPMN model from input stream
Model model = BPMNParser.parseModel(inputStream, "UTF-8");

The workitem can contain any kind of data to be evaluated by the business rules. Internally the Imixs BPMN Rule Engine is based on the Core-RuleEngine which supports various script languages to describe a rule.

The example BPMN model can be downloaded from Github . Install the Imixs-BPMN Modeler to examine the example.

More details about the Imixs BPMN Rule Engine can be find on the project site.

Imixs-Workflow & 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-Workflow 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-Workflow 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”

BPMN 2.0 – The Extension Mechansim

The ‘Business Process Model And Notation’ standard is a well designed notation for describing business workflows. BPMN 2.0 becomes the standard for modeling business logic and fits very well the model driven software design in agile software projects.

The BPMN language, which is based on XML, was intended for users at all levels, from the business analysts who create the initial design, to the developers who implement the technical details, and finally, to the business users responsible for managing and monitoring the processes. BPMN 2.0 has evolved to become a complete specification trying to fit the needs to all people involved in the design of a business process. But writing BPMN in XML and visualizing business processes becomes nearly impossible without the use of a graphical tool.

Continue reading “BPMN 2.0 – The Extension Mechansim”