Show TOC

Background documentationWorking With Formal Parameters Locate this document in the navigation structure

 

The values stored in the variables of the main voice application or the main component can be passed to the subcomponent. Similarly, the values stored in the variables of the subcomponent can be passed to the main component.

Scenario

x is a dataStore variable in the main application that has to be passed to the subcomponent and y is a dataStore variable in the subcomponent that has to be passed to the main application. In simple words you want assign y=x and x=y.

Note Note

Ensure that all the variables that you create are of the same data type.

End of the note.

To do this, you need to follow the steps below:

  1. 1. Create a main application Main_App that has a voice model with the following entities:

    • Start Point connector

    • Any voice or non-voice entity

    • Atleast one subcomponent and name it as Sub_App

      Note Note

      To create a subcomponent use the Voice Component entity.

      End of the note.
    • End Point connector

  2. In the Main_App, work through the following steps:

    1. Ensure that all the entities are connected

    2. Create a variable ‘x’ in the dataStore

    3. Double-click on the Sub_App voice component

  3. In the Sub_App, create a voice model with the following entities:

    1. Start Point connector

    2. Any voice or non-voice entity

    3. End Point Connector

  4. In the Sub_app, create an interface variable for the Start Point connector. To do this, follow the steps below:

    1. Select the Start Point connector

    2. Using the secondary mouse button, choose Define Data

    3. Create a variable ‘s’ in the Variable Manager

  5. In the Main_App, select the Sub_App voice component and work through the following steps:

    1. Using the secondary mouse button, choose In Mapping

    2. Map the variables in the dataStore to the variables of the In repository

    3. Assign s=x (The expression looks like ‘=@x’ in the assigned value column)

  6. In the Sub_App, create a variable ‘y’ in the dataStore

  7. In the Sub_App, select the Start Point element and work through the following steps:

    1. Using the secondary mouse button, choose Out Mapping

    2. Map the variables in the start repository to the variables in the dataStore of the sub-Component

    3. Assign y=s (The expression looks like ‘=@s’ in the assigned value column. This ensures that you have assigned y=x.)

  8. In the Sub_app, create an interface variable for the end point connector. To do this, follow the steps below:

    1. Select the End Point connector

    2. Using the secondary mouse button, choose Define Data

    3. Create a variable ‘e’ in the Variable Manager

  9. In the Sub_App, select the End Point element and work through the following steps:

    1. Using the secondary mouse button, choose In Mapping

    2. Map the variables in the dataStore of the Sub_App to the variables in the end repository

    3. Assign e=y (The expression looks like ‘=@y’ in the assigned value column)

  10. In the Main_App, select the Sub_App voice component and work through the following steps:

    1. Using the secondary mouse button, choose Out Mapping

    2. Map the variables in the Out repository to the variables of the dataStore

    3. Assign x=e (The expression looks like ‘=@e’ in the assigned value column. This ensures that you have assigned x=y.)