Entity State Example

Shows how the values of the entities that support pending state change at different stages during the MBO update process. The values that change between different states appear in bold.

Note these entity behaviors:
  • The isDirty flag is set if the entity changes in memory but is not yet written to the database. Once you save the MBO, this flag clears.
  • The replayCounter value that gets sent to the Unwired Server is the value in the database before you call submitPending. After a successful replay, that value is imported from the Unwired Server.
  • The last two entries in the table are two possible results from the operation; only one of these results can occur for a replay request.
Description Flags/Values
After reading from the database, before any changes are made.

isNew=false

isCreated=false

isDirty=false

isDeleted=false

isUpdated=false

pending=false

pendingChange='N'

replayCounter=33422977

replayPending=0

replayFailure=0

One or more attributes are changed, but changes not saved.

isNew=false

isCreated=false

isDirty=true

isDeleted=false

isUpdated=false

pending=false

pendingChange='N'

replayCounter=33422977

replayPending=0

replayFailure=0

After entity.save()[entity save] or entity.update()[entity update] is called.

isNew=false

isCreated=false

isDirty=false

isDeleted=false

isUpdated=true

pending=true

pendingChange='U'

replayCounter=33424979

replayPending=0

replayFailure=0

After entity.submitPending()[entity submitPending] is called to submit the MBO to the server.

isNew=false

isCreated=false

isDirty=false

isDeleted=false

isUpdated=true

pending=true

pendingChange='U'

replayCounter=33424981

replayPending=33424981

replayFailure=0

Possible result: the Unwired Server accepts the update, sends an import and a replayResult for the entity, and then refreshes the entity from the database.

isNew=false

isCreated=false

isDirty=false

isDeleted=false

isUpdated=false

pending=false

pendingChange='N'

replayCounter=33422977

replayPending=0

replayFailure=0

Possible result: The Unwired Server rejects the update, sends a replayFailure for the entity, and refreshes the entity from the database

isNew=false

isCreated=false

isDirty=false

isDeleted=false

isUpdated=true

pending=true

pendingChange='U'

replayCounter=33424981

replayPending=0

replayFailure=33424981