Temporary data

When you select the Use Temporary Data property in a DataConnect task, you allow the workflow tasks within the DataConnect task to process the incoming records from the staging table in session. In other words, the data can be manipulated before it is saved to the database.

Use a Get Temp Record task to retrieve a temporary record and use a Save Permanent Record task to save the current session changes. The Break task can remove a specific iteration from the session, or clear the session completely. The Break task can also fail a specific staging table row, or fail all staging table rows since the last Save Permanent Record.

When Use Temporary Data is checked, then as the workflow is processed, the record for the DataConnect task is the permanent record without changes from the staging table. Also, the record for the Get Temp Record task is the updated or incoming values from the staging table. This process enables data validation and cleansing of incoming values within the workflow and even data mapping on update if fields are blank in the staging tables.

Example of a single DataConnect task with temporary data

The following excerpt from a workflow shows a single DataConnect task that processes temporary data.

Figure 1. Single DataConnect task that processes temporary data
The image is explained in the text.
Table 1. DataConnect task settings
Field Description
Use Temporary Data Selected
Table 2. Break task settings
Field Description
Flow Type Continue
Task Status Success
Break Scope Current Scope
Discard Temporary Data All
Fail Staging Rows Selected, which sets All

The DataConnect task iterates through the staging table records, placing the inserted or updated records into the session. For each iteration, the workflow gets a temporary record, does something with it, and decides whether to keep it.

To keep the record, save the record permanently with a Save Permanent Record task. The Switch task fail condition uses the settings in the Break/Continue task to discard all session data. The fail condition also fails the staging rows that are used to generate the record in session, and continues to the next record in the iteration.

In this example of a single DataConnect task, setting Discard Temporary Data in the Break task to Current instead of All would have the same outcome.

Example of multiple DataConnect tasks with temporary data

The following excerpt from a workflow shows a DataConnect task that contains a second, child DataConnect task. This excerpt is an extension of the purchase order example that was shown earlier.

Figure 2. Multiple DataConnect tasks that process temporary data
The image is explained in the text.
Table 3. Outer DataConnect task settings
Field Description
Use Temporary Data Selected
Table 4. Outer Break task settings
Field Description
Flow Type Continue
Task Status Success
Break Scope Current Scope
Discard Temporary Data All
Fail Staging Rows Selected, which sets All

The outer DataConnect task iterates through the POBody staging table. For each iteration, the workflow gets a temporary record, does something with it, and decides whether to keep it. If there is an issue with the POBody record, the workflow runs the Break/Continue and discards all session data, fails the row, and moves on to the next POBody record.

If the POBody passes the Switch task, processing continues with the inner DataConnect task to handle the POLines for this POBody. The workflow might do one of several things based on what it finds and on the setting of the Break. You might have several Switch/Breaks and depending on your processing, the workflow might fail everything or just the one row.

The following scenarios show different uses of the Break and what would happen with the processing and the session:
  • Fail the current POLine, remove the record that it created or modified from the session, and fail that staging table row only. Processing continues on the next POLine for the POBody. The inner DataConnect task’s Break task uses the following properties:
    Table 5. Inner Break task settings
    Field Description
    Flow Type Continue
    Task Status Success
    Break Scope Current Scope
    Discard Temporary Data Current
    Fail Staging Rows Selected, which sets Current
  • Clear the current POBody iteration, remove the record that it created or modified from the session, fail the POBody staging table row, clear the POLines, and fail the POLines staging table rows. Processing continues on the next POBody. The inner DataConnect task’s Break task uses the following properties:
    Table 6. Inner Break task settings
    Field Description
    Flow Type Continue
    Task Status Success
    Break Scope Selected Block, Process Incoming POBody
    Discard Temporary Data All
    Fail Staging Rows Selected, which sets All
  • Nothing (no Break task in inner DataConnect).

Having the Save Permanent Record task after the end of the inner (POLine) DataConnect task ensures that the platform saves the POBody and the POLines that go with the POBody.