Update Storable - Xyna-Factory/xyna GitHub Wiki

The Update service of the service group xnwh.persistence.PersistenceService is a coded service which is used to perform an SQL update command on specific attributes of a Xyna Storable instance. Dragging a Store Storable into a Workflow you can configure an existing instance of Data Type xnwh.persistence.Storable that shall be updated during the Workflow's execution.

Add an Update to the Workflow

To insert the Update service into a Workflow, enter the string "update" in the Search Panel on the right and drag the element named "PersistenceServices.Update" out of the search result area.

Configure an Update

The Update service has three Input Parameters:

  • Storable: Parameter for the Storable instance that shall be updated. You can configure the values of the instance inside of a Mapping or by setting a constant, for example.
  • Selection mask:
    • Root type: FQN of the Storable datatype known to the Xyna Factory.
    • Columns: This parameter is used to define the columns that shall be updated. Add one list element for each column you want to update and set its value to the variable name of the respective Member Variable. Syntax: For a top level Member Variable named member use %0%.member; for attributes of complex members or lists use %0%.complexMember.attribute or %0%.list[].attribute, respectively. (Beware: You have to give the index for every single list element, unless you want to overwrite the whole list with the value of list[0], like this: %0%.list["1"].attribute. If you desire that all list elements are updated with their respective values (given by the passed Storable instance), you can achieve this, for instance, by building the columns object within a foreach loop.)
  • Update parameter: These parameters define how to deal with historization and meta data at storage.
    • Historize previous object: Can take the values true or false and indicates whether an already existing version of the passed instance shall be historized (backed up). The existing instance will then be marked as obsolete (Current Version Flag = false) and the new instance will be marked as current (Current Version Flag = true). The default setting is false (i.e. Historize previous object = false would override an existing instance, that would no longer be available then). Please note: Only takes effect for Data Types flagged as Use historization (cf. Historization).
    • Keep meta field data: Can take the values true or false. This field specifies if meta data (e.g. Historization Time Stamp), which are normally assigned automatically, shall explicitly be overridden with own data. The default setting is false (for an example see this section in the Store article).

See Also