Transaction Server Data State Steps
A step definition reference for checking the back-end system during transaction processing.
A transaction server data state step references a step definition within the same module to be run by the Agentry Server to check the back-end system for data collisions during transaction processing. Server data state steps are the first steps run by the Server when a transaction is being processed. When a data state step’s return is true, its defined data state is set for the transaction. This data state will then affect which server update steps for the transaction are run by the Server. A data state step may also define a response to be sent to the Client to perform some additional action in relation to the object instance targeted by the transaction.
The step executed by a data state step should be defined to either return data or not, based on some condition. The data returned by a data state step is unimportant in most cases. The exception to this is when the Client Response attribute is set to “Update Client Key Property.” In this scenario the Agentry Server will expect the step to return a value identified as the key property for the target object.
Other than in this situation, the Server only looks to see if data is returned by the step. By default, when data is returned by a data state step, the Server treats this as a true response and will set the defined data state for the transaction. No data will be treated as false. This logic may be inverted, with data return treated as false and no data treated as true, if the logic of the step being executed is more efficient or more practical to be written in this manner.
If multiple server data state steps return true for a single transaction instance, the defined data state for the last step with a true return will be the one set for the transaction. The server data state steps may be defined to halt further data state step processing for the transaction if one of them returns true. The order in which server data state steps are processed is defined in the list of these definitions displayed in the transaction definition’s properties view of the Editor.
The Client Response attribute allows for the definition of a response to be sent to the Client in relation to the object targeted by the transaction. This response will be sent after the transaction has been successfully processed by the Server. The defined Client Response for a data state may be overridden by a subsequent data state step, or by the transaction’s server update steps.
Server Data State Step Attributes
- Step: This attribute references the step definition within the same module to run as a server data state step for the transaction.
- Data State: This text value is the name of the data state the data state step will set if its return is true. This value can then be referenced by the server update steps for the same transaction.
- Step is True if: This attribute is set to define what
is treated as true for the data state step. When a data state step
is true, its defined data state is set for the transaction. Its available
options depend on the type of step selected in the Step attribute:
- SQL Step: For a SQL step, this attribute can be set to “1 or more rows are returned” or “0 rows are returned”. The former will treat data being returned as true and no data returned as false. The latter will treat data returned as false and no data returned as true.
- Java Step: For a Java step, the options are “doSteplet returns True” and “doSteplet returns False”. The first will treat a true return from the doSteplet() method of the Java step as true. The second will treat a false response from the doSteplet() method as true.
- HTTP-XML Step: For an HTTP-XML step, the available options for this attribute are “All response mappings succeed” and “A response mapping fails”. The former will set true for the data state when the HTTP-XML step is able to map all of the responses, per its definition. The latter will treat one or more failed mappings as true.
- If True: This attribute specifies whether the remaining server data state steps for the transaction should be processed if the data state step returns true.
- If False: This attribute specifies whether the remaining server data state steps for the transaction should be processed if the data state step returns false.
- Response to Client: This attribute specifies what response is sent to the Agentry Client after the Update Step has been processed. The response defined here will only be sent if the data state step is run and returns true. The responses that may be sent are “Delete Client Object”, “Replace Client Object”, “Update Client Key Property”, and “No Action Required”. If “Update Client Key Property” is set, the step being run by the server data state step is expected to return a value identified as the transaction’s target object’s key property. This value will replace the current value of this property on the Client for that object instance.