Show TOC

Transferring Data Using a Data ShareLocate this document in the navigation structure

Context

The Data Share connector is usually used with complex data, for two main purposes:

  • To maintain a single copy of a dataset for use by multiple elements within a complex model. This is achieved by setting the Scope property of the data share to Private (in the Configure task panel). Unlike the Data Store connector, you can have multiple instances of the data share within a single model. In addition, the records stored in the data share are deleted upon execution of every mapping into that data share.

  • Define bi-directional data sharing of complex datasets between Visual Composer components or between a Visual Composer and another Composition-tool component (such as a Guided Procedures process). This is achieved by setting the Scope property of the data share to Public .

When the source data of the data share is modified, the changes are reflected automatically in the connected components. You can add data to a data share by:

  • Connecting it to a data service or other model element

  • Using the Define Data dialog box for the data share

The dataset of the Data Share connector must have the same metadata and data type as the dataset of the element to which it is connected. Visual Composer does not check that the datasets match, so you must manually check the data types before you create the connection.

Procedure


  1. On the Design board, add a Data Share connector to the component in one of the following ways, as relevant:

    • Drag a Data Share connector icon from the Compose task panel.

    • If the model contains a nested view with a Data Share connector, drag out from the data-share port on the nested view icon, and choose the appropriate mode element (such as Form View ) from the context menu.

    • Drag out from an input port of a data service that contains a clustered dataset and add a view element. A Data Share connector is automatically added together with the view element.

      Note

      The view element is automatically bound to the data share and uses its dataset. You can right-click the view element and choose Detach Data Share from the context menu if you want to break the bind connection between the two elements.

  2. Double-click the data share to display the Configure task panel and define the Scope of the connector:

    • To share data between the elements of the model, choose Private .

    • To share the data of the data share in the open model with other Visual Composer models or components of other Composition tools, choose Public .

  3. If you added the data share by dragging it from the Compose task panel, add data to it in one of the following ways:

    • Use the Import from Service wizard to import data from a data service. The Import from Service wizard enables you to add data from a data service without adding a dependency to the data service to your model.

      1. If the connector contains no data, you can use the Import from Service wizard to import data from a data service in the model.

        1. Right-click the Data Share icon and choose Import from Service from the context menu. The Import from Service wizard is displayed.

        2. In the Select Data Service step, search for the data service whose data you want to add to the connector for sharing. The search options in this step are the same as the options in the Search task panel. For more information, see Discovering Data Services .

        3. In the Select Port step, choose the data-service port whose data you want to import.

        4. Click Finish . The data is added to the connector. You can display the data in the Define Data dialog box.

    • Use the Define Data dialog box to manually define data:

      1. Right-click the Data Share icon and choose Define Data from the context menu. The Define Data dialog box is displayed.

      2. Insert the fields you need using the tools in the Define Data dialog box. For more information, see Define Data Dialog Box in the Visual Composer Reference Guide .

      Note

      If a data share has been added to a nested view in your model, or the data in the share has been modified, perform Redefine Ports on the nested view to identify the changes that have been made.

      Note

      If you defined a Scope of Private for your model, you can use the Initialize Data button in the left pane of the dialog box to define initialization values for the data share.

  4. Connect the Data Share connector to other elements in the model, as required. The data-share port can serve as an in port and as an out port. You can connect a Data Share connector as follows:

    • Drag from the data-share port of a nested view and connect it to an out port of a data service or another Data Share connector, using a single data-bind connection.

    • Within a component, connect a Data Share connector to the in port or out port of any other element, by dragging from the Data Share connector port to the element port. You can connect the data-share port to multiple elements, using multiple data bind, flow, and mapping connections.

    • Drag from the data-share port of a nested view that contains a Data Share connector, and connect it to an out port of a data service or another Data Share connector, using a single data-bind connection.

Results

The Data Share connector is added and configured to share data with the connected elements and external components, according to your data-share configuration.

Note

The Data Share connector is created automatically when creating a Form View or a Table View by dragging out from the input of another embedded component that contains clustered data. The created data share:

  • Contains the clustered structure of the port it was dragged from.

  • Is automatically attached to the Form View or Table View . To detach the data share from the element, right-click the element and choose Detach Data Share from the context menu.

Example

The following example bi-directionally transfers data between a nested composite view and a parent composite view using two Data Share connectors. The parent composite view is then accessed from Guided Procedures via the data-share port on the parent composite view.