Cafienne Engine Release 1.1.9
Case File on Steroids
This release holds a number of major enhancements to the core of the platform in handling the Case File. The data file in the case has now become the much prominent citizen, which it always promised to be. It gives a range of new options in handling events that happen outside the context of task handling, and at the same time the task output handling can be controlled in a much more detailed manner.
Important - upgrading from earlier versions requires configuration changes (more details below)
Nested structures are updated smartly
The commands to manipulate items in the Case File have become much more intelligent.
- Updating or replacing an item that has multiplicity one or more (i.e., an array) was not supported until this release. This is now enabled with a specific implementation.
- A list of objects being passed in the Update (or Replace) command leads to an Update (or Replace) for each of the elements in the list being passed. So, if the existing case file item has more than 10 items, and the update contains 3 elements, the first 3 items in the existing array will be updated (or replaced, depending on the type of command) with the new information
- When an object instead of a list is being passed with the command, then the "current" item in the array is given the command. "Current" in practice is the last modified element in the case file item array. Note, this is similar to the behavior for passing array type of case file items into e.g. task input parameters, then also the "current" is being passed.
- When updating a case file item with a complex JSON structure (i.e., holding both properties and children) now intelligently merges each and every case file item that is updated through the structure. This means that when a child or grandchild does not get a new value for any of it's properties, then no Update event will be generated. Also, when a child did not yet exist, a Create event will be generated for it.
- With above two features, it is now also possible to update the Case File with complex task output.
New options in completing a Task with output
Until this release, whenever a Task is completed, the binding of Task output parameters to the Case File is done with either a Create or a Replace event, depending on the state of the underlying Case File Item. In this release we introduce a first implementation for CMMN's BindingRefinement concept. If the expression in the BindingRefinement is set, the value will be used to determine the action on the Case File Item. Options
- Add
- If the case file item is an array, the task output will be added to the array, leading to Create events.
- If the case file item is not an array, the item will be created, or updated if it already exists.
- Update
- If the case file item is an array, and the task output is a list, then all items in the case file item array will be merged with the new information;
- If the case file item is an array, and the task output is an object, then the "current" case file item in the array will be merged with the new information
- If the case file item is not an array, the new information will be merged in the existing value of the item. If the item is not yet created, this leads to a Create event, otherwise an Update event is generated.
- Replace - Similar to the Update operation, but instead of merging the new information, the current information will be overwritten.
Existing Configurations need a change
Dependency updates in this release have upgraded to the latest version of the Akka Runtime. However, this new version of Akka (2.6.6) breaks existing Cafienne configurations. Therefore, on existing Cafienne installations, the settings must be updated according to the below scheme.
Below settings must be replaced
serializers {
command_serializer = "org.cafienne.akka.actor.serialization.CommandSerializer"
response_serializer = "org.cafienne.akka.actor.serialization.ResponseSerializer"
event_serializer = "org.cafienne.akka.actor.serialization.EventSerializer"
snapshot_serializer = "org.cafienne.akka.actor.serialization.SnapshotSerializer"
# offset_serializer is used to serialize offset snapshots
offset_serializer = "org.cafienne.infrastructure.eventstore.OffsetSerializer"
}
serialization-bindings {
"org.cafienne.akka.actor.event.ModelEvent" = event_serializer
"org.cafienne.akka.actor.command.ModelCommand" = command_serializer
"org.cafienne.akka.actor.command.response.ModelResponse" = response_serializer
"org.cafienne.akka.actor.snapshot.ModelActorSnapshot" = snapshot_serializer
# Current offsets are WrappedOffset objects
"org.cafienne.infrastructure.eventstore.WrappedOffset" = offset_serializer
}
New settings to be used
serializers {
cafienne_serializer = "org.cafienne.akka.actor.serialization.CafienneSerializer"
# offset_serializer is used to serialize offset snapshots
offset_serializer = "org.cafienne.infrastructure.eventstore.OffsetSerializer"
}
serialization-bindings {
"org.cafienne.akka.actor.serialization.CafienneSerializable" = cafienne_serializer
# Current offsets are WrappedOffset objects
"org.cafienne.infrastructure.eventstore.WrappedOffset" = offset_serializer
}
More Debug Information
Debug statements have been added in quite a few places in the engine
- calls to external webservices generate much more information (e.g. full request and response information)
- missing and undefined properties in task output mappings are logged
- expressions used in e.g. required rule, repetition rule, etc. generate debug information when they access a non-existing property
Other topics
- A new API to retrieve the definition of a case instance has been added
- An internal cache for storing user information avoids repeated database roundtrips to retrieve a users' tenant information
- Support for
map(...)
andlist(...)
in expressions, to enable smart update of case file items upon task output mapping
Housekeeping
This release holds various dependency updates, e.g. on latest version of the underlying Akka runtime. Furthermore internal refactoring took place to reduce and simplify the engine code, making it better maintainable.