EntityStateJob

public abstract class EntityStateJob extends EntityJob

The EntityStateJob is the abstract base class for four EntityJobs:

  1. The InitEntityState job reads ClientMessages or StateProperties with tag state and converts them into instances of State. This job runs during WriteTransactions. This job runs during the INIT Phase and does not perform any checks other than those necessary for the conversion.

  2. The CheckStateTransition job checks if the attempted state transition is in compliance with the state model. This job runs during the CHECK phase and should do all necessary consistency and permission checks.

  3. The MakeStateProperty job constructs an ordinary Property from the State right before the entity is being written to the back-end and after any checks run.

  4. The MakeStateMessage job converts a state property (back) into State messages and appends them to the entity.

Only the 4th job (MakeStateMessage) runs during Retrieve transitions. During WriteTransactions all four jobs do run.

Author:

Timm Fitschen

Fields

COULD_NOT_CONSTRUCT_STATE_MESSAGE

public static final Message COULD_NOT_CONSTRUCT_STATE_MESSAGE

COULD_NOT_CONSTRUCT_TRANSITIONS

public static final Message COULD_NOT_CONSTRUCT_TRANSITIONS

ENTITY_STATE_ROLE_MARKER

public static final String ENTITY_STATE_ROLE_MARKER

FINAL_STATE_PROPERTY_NAME

public static final String FINAL_STATE_PROPERTY_NAME

FROM_STATE_PROPERTY_NAME

public static final String FROM_STATE_PROPERTY_NAME

FROM_XML_TAG

public static final String FROM_XML_TAG

INITIAL_STATE_PROPERTY_NAME

public static final String INITIAL_STATE_PROPERTY_NAME

PERMISSION_STATE_TRANSION

public static final TransitionPermission PERMISSION_STATE_TRANSION

SERVER_PROPERTY_EXT_ENTITY_STATE

protected static final String SERVER_PROPERTY_EXT_ENTITY_STATE

STATE_ATTRIBUTE_DESCRIPTION

public static final String STATE_ATTRIBUTE_DESCRIPTION

STATE_ATTRIBUTE_ID

public static final String STATE_ATTRIBUTE_ID

STATE_ATTRIBUTE_MODEL

public static final String STATE_ATTRIBUTE_MODEL

STATE_ATTRIBUTE_NAME

public static final String STATE_ATTRIBUTE_NAME

STATE_MODEL_NOT_FOUND

public static final Message STATE_MODEL_NOT_FOUND

STATE_MODEL_NOT_SPECIFIED

public static final Message STATE_MODEL_NOT_SPECIFIED

STATE_MODEL_RECORD_TYPE_NAME

public static final String STATE_MODEL_RECORD_TYPE_NAME

STATE_NOT_IN_STATE_MODEL

public static final Message STATE_NOT_IN_STATE_MODEL

STATE_NOT_SPECIFIED

public static final Message STATE_NOT_SPECIFIED

STATE_PERMISSIONS

public static final ACMPermissions STATE_PERMISSIONS

STATE_RECORD_TYPE_NAME

public static final String STATE_RECORD_TYPE_NAME

STATE_XML_TAG

public static final String STATE_XML_TAG

TO_STATE_PROPERTY_NAME

public static final String TO_STATE_PROPERTY_NAME

TO_XML_TAG

public static final String TO_XML_TAG

TRANSITION_ATTRIBUTE_DESCRIPTION

public static final String TRANSITION_ATTRIBUTE_DESCRIPTION

TRANSITION_ATTRIBUTE_NAME

public static final String TRANSITION_ATTRIBUTE_NAME

TRANSITION_RECORD_TYPE_NAME

public static final String TRANSITION_RECORD_TYPE_NAME

TRANSITION_XML_TAG

public static final String TRANSITION_XML_TAG

Methods

createState

protected State createState(ClientMessage s)

createState

protected State createState(Property p)

Create a State instance from the value of the state property.

This method also retrieves the state entity from the back-end. The StateModel is deduced from finding an appropriately referencing StateModel Record.

Parameters:
  • p – the entity’s state property

Throws:
Returns:

The state of the entity

findStateModel

EntityInterface findStateModel(EntityInterface stateEntity)

getState

protected State getState()

getState

protected State getState(EntityInterface entity)

getState

protected State getState(EntityInterface entity, boolean remove)

getState

protected State getState(boolean remove)

getStateClientMessages

protected List<ClientMessage> getStateClientMessages(EntityInterface entity, boolean remove)

Get the ClientMessages which denote a state.

getStateClientMessages

protected List<ClientMessage> getStateClientMessages(boolean remove)

getStateProperties

protected List<Property> getStateProperties(EntityInterface entity, boolean remove)

Return (and possibly remove) the States Properties of entity.

getStateProperties

protected List<Property> getStateProperties(boolean remove)

getStateRecordType

protected EntityInterface getStateRecordType()

removeCached

protected void removeCached(EntityInterface entity)