Blog Posts bpmn-1-x Process Management

Simulating Workflows

Blog: Imixs Workflow Blog

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.

Leave a Comment

Get the BPI Web Feed

Using the HTML code below, you can display this Business Process Incubator page content with the current filter and sorting inside your web site for FREE.

Copy/Paste this code in your website html code:

<iframe src="https://www.businessprocessincubator.com/content/simulating-workflows/?feed=html" frameborder="0" scrolling="auto" width="100%" height="700">

Customizing your BPI Web Feed

You can click on the Get the BPI Web Feed link on any of our page to create the best possible feed for your site. Here are a few tips to customize your BPI Web Feed.

Customizing the Content Filter
On any page, you can add filter criteria using the MORE FILTERS interface:

Customizing the Content Filter

Customizing the Content Sorting
Clicking on the sorting options will also change the way your BPI Web Feed will be ordered on your site:

Get the BPI Web Feed

Some integration examples

BPMN.org

XPDL.org

×