Altova MobileTogether Designer

Saves data of the page source that is selected in the action's combo box to the default file of that page source. The data source must be an editable XML file or DB. To save data to multiple data sources, add multiple Save actions. Note that page sources that are read as JSON will also be saved as JSON (not as XML even though the data is presented in the GUI as an XML tree); also see Page Source Options.

MTDSave

Error processing

The On Error option lets you define what should be done if an error occurs. Since the error handling can be precisely defined for this action, errors on such actions (that provide error handling) are treated as warnings—and not errors. The advantage is that you do not need to check errors on actions for which error handling has already been defined. The following error handling options are available:

 

Abort Script: After an error occurs, all subsequent actions of the triggered event are terminated. This is the default action if an error occurs. If you wish to continue despite an error, select either the Continue or Throw option.

Continue: Actions are not terminated. Instead, you can select what to do in either event: when there is no error (On Success), or when there is an error (On Error). For example, you might want to display a message box saying whether a page load was successful or not.

Throw: If an error is detected, this option throws an exception that is stored in the Try/Catch action's variable. The Catch part of the Try/Catch action is used to specify what action to take if an error occurs. If no error occurs, then the next action is processed. See the section Try/Catch action for details.

 

Save to DB

If the data source that is being saved is a DB, then, by default, all editable columns are selected for being updated (see screenshot below). You can choose to save the modified data only (primary key needed), or all table rows (no primary key needed). If you select Replace All Table Rows, then all rows in the DB are deleted and all the rows of the page source are inserted; note, however, that primary keys of new rows are not saved to the DB. There is also an option to save all table rows only if some data anywhere in the table has been modified. The Save Modifications Only option uses the primary key to check for modifications, and saves the modifications only; new rows are saved with their primary keys. If you wish to select an option that checks for modifications, then make sure that an OriginalRowSet has been created for the table; otherwise an error will be reported on validation. To define how changes are to be saved to related tables, click the Relations button.

MTDSaveDB

Save related tables

To specify how to save related tables, click the Relations button icAdditionalDialog. This displays the Database Relation Save Settings dialog, which shows the related tables. In the combo box of each related table you can choose from the following options: (i) Replace all table rows of the related table; (ii) In the related table, save modifications only; (iii) Not save any changes to the related table.

 

When making these choices, take into account any private-key to foreign-key relations that exist between the main and related tables.

 

You can also access the save settings of the related table of a DB page source via the context menu of the page source in the Page Sources Pane.

 

Save DB columns

To select specific columns to update, click the All Columns button icAdditionalDialog. This displays the Database Column Save Settings dialog (screenshot below).

MTDSaveDBColumns

The dialog displays the columns of the DB page source. You can specify which columns can be updated or can take inserted values. (Updates refer to modified data in existing row elements; inserted values refer to data in newly added row elements.) By default, the Insert and Update options of each column are selected together as a pair. If, however, you wish to specify different options for a column's Insert and Update options, check the Use separate filter settings for Insert and Update statements check box. Attributes with empty values can be converted to NULL values in the DB by checking that column's NULL check box. Note that missing attributes will always be saved as NULL.

 

Columns that cannot be updated (because they are user-defined, fixed-value, or calculated-value) will not have an Insert, Update, or NULL option check box. In the screenshot above, the ID column cannot be updated because it holds fixed values. Deselect the columns you do not want to update.

 

You can specify the order in which deletions, updates, and insertions occur by selecting the desired order in the combo box at the bottom of the dialog.

 

If you wish to reset the Save settings so that all columns are updated, click Reset to default.

 

MobileTogether extension functions

MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.

 

mt-external-error-code()

mt-external-error-text()

mt-external-error-code()

mt-get-source-from-name()

mt-get-source-name()

mt-get-source-structure()

 

© 2018-2024 Altova GmbH