Skip to main content

Claims

By default, when an EngineService starts a new batch, it searches for all DataElement with the correct beginState by using a standard finder. However, if an engine runs alongside other nodes, introducing claims will allow for better communication between the nodes.

Claims require 3 parts to be configured:

  • A Claim DataElement with the option is isClaimElement that will be used to represent claims
  • The target DataElement should have an option isClaimable pointing towards the Claim DataElement
  • The FlowElement should have the option useClaims
Option
useClaims FlowElement

Forces the EngineBean to claim its instances before it starts processing. These instances will be claimed with the id of the EngineService run.

The target DataElement of this FlowElement should be Claimable.

<options>
<useClaims/>
</options>
Option
isClaimElement DataElement

Claim elements are DataElements that are used to store claims for other data elements. A claim element must have the following fields:

  • element(String): is used in combination with 'targetId' to uniquely identify the claimed instance
  • targetId(Long): the id of the target instance that is claimed
  • claimId(String): an id to identify the owner of the claim, which can refer to a user or a unique id of the engine run
  • timeout(Date): keeps the time until which the claim is valid

For a data element to use this element for its claims, it must be configured with the option isClaimable and reference this element.

<options>
<isClaimElement/>
</options>
Option
isClaimable DataElement

Labels the DataElement as claimable. The value of the option should point to the correct claimElement.

If the value of the option is left blank, it will default to a claim element with name <component>::<component>Claim (e.g. for component 'euRent', 'euRent.EuRentClaim').

Adding this option also makes it possible to define finders based on claims

<options>
<isClaimable>space::StarshipClaim</isClaimable>
</options>