Feature Pack 7 or later

Obtaining the command context

Commands can obtain information from the command context. For example, available information includes the user's ID, the user object, the language identifier, and the store identifier. The command context must be set to a controller command before it is run.
The following logic exists in the REST framework to facilitate the command context:
  1. A business context is created based on the resolved context data and activity token. A generic activity token is generated when no activity token is presented.
  2. The startRequest(ActivityToken, ActivityData) method is called on the Business Context Service (BCS) to indicate that a controller command or data bean is about to start.
  3. The created business context is associated to the controller command or the data bean manager.
  4. The controller command is run, or the data bean to run the action is activated.
  5. The endRequest(ActivityToken) method is called on the BCS to indicate that the operation is complete.