Finders based on claims

Claimable elements can also have finders that filter on instances that are (not) claimed. For this, there are the options findByClaimed/findByNotClaimed.

If the name of the finder contains By(Not)Claimed, the Prime Radiant will automatically add the correct option to the finder.

If the isClaimable option has been added to a dataElement, the PR will automatically generate the finders on claimed/unclaimed instances required for the workflow.

E.g. the finder findByStatusEq_Claimed will generate the following class (some ):

public class OrderFindByStatusEq_ClaimedDetails implements java.io.Serializable {

    private static final long serialVersionUID = 1L;

    private String mStatus;
    private ClaimId mClaimId;

    public OrderFindByStateEq_ClaimedDetails() {
    }

    // getters and setters ...

}

Depending on the claimId passed to the finder, the search will return

all instances claimed by an engine:

OrderFindByStatusEq_ClaimedDetails finder = new OrderFindByStatusEq_ClaimedDetails();
finder.setStatus("Ready");
finder.setClaimId(ClaimId.fromRunId(runId));

all instances claimed by a user:

OrderFindByStatusEq_ClaimedDetails finder = new OrderFindByStatusEq_ClaimedDetails();
finder.setStatus("Ready");
finder.setClaimId(ClaimId.fromUserContext(userContext));

all claimed instances:

OrderFindByStatusEq_ClaimedDetails finder = new OrderFindByStatusEq_ClaimedDetails();
finder.setStatus("Ready");
finder.setClaimId(ClaimId.any());

A ‘findByNotClaimed’-finder will find the inverse:

  • not claimed by a specific engine,
  • not claimed by a specific user or
  • not claimed at all

Version

Release Expander version Change
201712 3.2.0 implemented

References