SharedData

The SharedData Activity enables sharing of runtime data within a flow or across flows in an app. This Activity simplifies your flow designs. The advantage of using this feature is that you can set data anywhere in the main flow, subflow, or error handler and the data can be shared across the entire flow or app.

This Activity involves the following operations:

  • Get: Retrieves data from the selected scope (either flow or app) based on a key.

  • Set: Sets data for the selected scope based on a key.

  • Delete: Deletes data from the app data.

For example, you can set the values in a parent flow. In a subflow, you can add the SharedData Activity and use the Get operation to access the values set in the parent flow.

Settings

The Settings tab has the following fields.

Field Description
Scope

Options are:

  • Flow: Data can be shared within the flow instance and its subflow instances only.
  • Application: Data can be shared across flow instances within an app.

Default: Flow

Operation

The operation to be performed. Options are:

  • Get: Retrieve the data from the selected scope by key.
  • Set: Set the data for the selected scope by key.
  • Delete: (Available only if Scope is selected as Application)
    Optionally, you can delete app data based on the input key. For example, if you need data for one-time use only, you can delete the data to avoid storing it in memory unnecessarily. Otherwise, the data is deleted when you scale down or stop the app.

Default: Get

Data Type

The data type of the shared data. Supported types are string, integer, number, and object.

Object Schema (Only if you select Data Type as object) Specify the object's JSON data or schema in Object Schema. You can also specify an app-level schema by using the Use app-level schema option.

Input

This tab displays the fields that are used as input for the Activity.

Input Item Description
key

Available operations are:

  • Set: Specify any value that you want to use while setting the data.
  • Get: If you want to retrieve data using the Get operation, you must use the same value that was specified while using the Set operation for setting the data for a scope.

App properties can also be used to set or get the key.

input/data

(Set operation only) You can provide values of the Data Type selected on the Settings tab.

Output

This tab displays the output of the Activity. Note that the Set operation does not have any output.

Input Item Description
exist Indicates whether the data for the key specified on the Input tab exists.
data Output data based on the input specified on the Input tab.

Loop

For information on the Loop tab, see the "Using the Loop Feature in an Activity" section in the TIBCO Flogo® Enterprise User Guide.