You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Imixs-Workflow project provides a services and test environments to simulate and test the processing life cycle of a specific model or process instance.
3
+
The Imixs-Workflow project provides services and test environments to simulate and test the processing life cycle of a specific model or process instance. You can use these services to implement JUnit test classes to test without the need of a full deployment.
4
4
5
-
## Simulate a Processing Live Cycle
5
+
For a Maven project just add the following dependencies into your projects `pom.xml` file:
The `WorkflowService` provides a method called `evalNextTask`. This method evaluates the next task for a process instance (workitem) based on the current model definition. A Workitem must at least provide the properties `$TASKID` and `$EVENTID`. The method call can be helpful in many cases when a business logic just need to compute the next logical BPMN Task Element which will be assigned with a given process instance.
116
+
```
117
+
118
+
## Simulate a Processing Live Cycle
8
119
120
+
The `WorkflowService` provides a method called `evalNextTask`. This method evaluates the next task for a process instance (workitem) based on the current model definition. A Workitem must at least provide the properties `$TASKID` and `$EVENTID`. The method call can be helpful in many cases when a business logic just need to compute the next logical BPMN Task Element which will be assigned with a given process instance.
9
121
10
122
```java
11
123
try {
12
-
// simulate the processing life cycle of a given workitem
**Note:** During the evaluation life-cycle more than one events can be evaluated. This depends on the model definition which can define follow-up-events, split-events and conditional events. The `evalNextTask` method did not persist the process instance or execute any plugin or adapter classes.
20
132
21
-
22
133
## Testing with the WorkflowMockEnvironment
23
134
24
-
The Test class `WorkflowMockEnvironment`mocks a full workflow environment including a in-memory-database. The `WorkflowMockEnvironment` can be used for more complex integration tests using JUnit 5 or higher.
135
+
The Test class `WorkflowMockEnvironment` mocks a full workflow environment including a in-memory-database. The `WorkflowMockEnvironment` can be used for more complex integration tests using JUnit 5 or higher.
To setup a test case the Imixs `WorkflowMockEnvironment` provides a setup method to initialize the environment and a loadBPMNModel method to load a test model. To setup the environment it is recommended to call the setup() method in a `org.junit.jupiter.api.BeforeEach` annotated init method:
201
+
202
+
To setup a test case the Imixs `WorkflowMockEnvironment` provides a setup method to initialize the environment and the method `loadBPMNModel` to load a test model. To setup the environment it is recommended to call the setup() method in a `org.junit.jupiter.api.BeforeEach` annotated init method:
The main goal of the `WorkflowMockEnvironment` is to test business logic of a specific workflow model. A workflow instance can be created form a empty ItemCollection and tested with any kind of data.
214
+
215
+
The main goal of the `WorkflowMockEnvironment` is to test business logic of a specific workflow model. A workflow instance can be created form a empty ItemCollection and tested with any kind of data.
The `WorkflowMockEnvironment` also allows you to test custom Imixs Workflow `GenericAdapter` or `SignalAdapter` classes. You just need to call the method `registerAdapter(...)` method before you call `setup()`. See the following example:
235
+
The `WorkflowMockEnvironment` also allows you to test custom Imixs Workflow `GenericAdapter` or `SignalAdapter` classes. You just need to call the method `registerAdapter(...)` method before you call `setup()`. See the following example:
0 commit comments