Developing Apama Applications > Developing Apama Applications in Event Modeler > Working with Blocks Created from Scenarios > Descriptions of scenario block operations
Descriptions of scenario block operations
You can call the following operations on a scenario block:
*create — Creates a sub-scenario.
*delete — Deletes the sub-scenario identified by the value of the instance id parameter.
*delete all — Deletes all sub-scenarios that this scenario block manages. The sub-scenarios that a scenario block manages are the sub-scenarios that the scenario block created and has not yet deleted. A main scenario can use two or more instances of the same scenario block. Each scenario block manages only the sub-scenarios it creates. In a main scenario, the A1 scenario block has no information about sub-scenarios created by the A2 scenario block.
*retrieve — Retrieves the sub-scenario identified by the value of the instance id parameter. The retrieved sub-scenario becomes the context instance. To modify any values associated with a sub-scenario, the sub-scenario must be the context instance. The retrieve operation does not modify the current values of the scenario block’s parameters.
*commit — Changes and saves the values of the context sub-scenario’s input variables that correspond to scenario block parameters whose values have changed since the previous create, iterate, next, retrieve, or commit operation, whichever came last.
*iterate — Starts an iteration through the sub-scenarios that this scenario block manages. After you call the iterate operation, the first sub-scenario that the block created is the context sub-scenario. You do not need to call the next operation to retrieve the first sub-scenario. To restart an iteration, call the iterate operation again.
*next — Moves to the next sub-scenario in the iteration and makes that sub-scenario, if there is one, the context instance. The next operation visits the sub-scenarios in the order in which the scenario block created them.
Call this operation after a call to the iterate operation. When you call next, if there is a valid next instance, the scenario block sends an event to the output feed. You can obtain the instance ID for the new context instance from this event.
There are no timing issues because the scenario block immediately performs the next operation and sends an event to the output feed. That is, you do not need to wait for the next operation to complete before you issue an action that operates on the sub-scenario that is the context instance as a result of the next operation.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.