EntityStateJob
- public abstract class EntityStateJob extends EntityJob
The EntityStateJob is the abstract base class for four EntityJobs:
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.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.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.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
COULD_NOT_CONSTRUCT_TRANSITIONS
ENTITY_STATE_ROLE_MARKER
FINAL_STATE_PROPERTY_NAME
FROM_STATE_PROPERTY_NAME
FROM_XML_TAG
INITIAL_STATE_PROPERTY_NAME
PERMISSION_STATE_TRANSION
- public static final TransitionPermission PERMISSION_STATE_TRANSION
SERVER_PROPERTY_EXT_ENTITY_STATE
STATE_ATTRIBUTE_DESCRIPTION
STATE_ATTRIBUTE_ID
STATE_ATTRIBUTE_MODEL
STATE_ATTRIBUTE_NAME
STATE_MODEL_NOT_FOUND
STATE_MODEL_NOT_SPECIFIED
STATE_MODEL_RECORD_TYPE_NAME
STATE_NOT_IN_STATE_MODEL
STATE_NOT_SPECIFIED
STATE_PERMISSIONS
- public static final ACMPermissions STATE_PERMISSIONS
STATE_RECORD_TYPE_NAME
STATE_XML_TAG
TO_STATE_PROPERTY_NAME
TO_XML_TAG
TRANSITION_ATTRIBUTE_DESCRIPTION
TRANSITION_ATTRIBUTE_NAME
TRANSITION_RECORD_TYPE_NAME
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:
Message
–
- Returns:
The state of the entity
findStateModel
- EntityInterface findStateModel(EntityInterface stateEntity)
getState
getState
- protected State getState(EntityInterface entity)
getState
- protected State getState(EntityInterface entity, boolean remove)
getState
getStateClientMessages
- protected List<ClientMessage> getStateClientMessages(EntityInterface entity, boolean remove)
Get the
ClientMessage
s 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
getStateRecordType
- protected EntityInterface getStateRecordType()
removeCached
- protected void removeCached(EntityInterface entity)