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.