Using Context Schema

Context schema allows you to map Context Variable with any element of schema.

This section explains you how to use context schema to map context variable. 
High level steps to use context schema are as follows:

Create Context Schema Definition

First of all you need to create context schema definition. Context schema definition contains name of the context variable that you want to map to other element. While creating context schema definition, you can create context variables or you can import it from the process flow within which you want to use this mapping activity. 
 

Steps to create Context Schema Definition

  1. In Data Mapper applet, from the Action menu select Create Context Schema Definition. The Create Context Schema Definition Dialog window is displayed ( see Figure 474 ).

    Figure 474: Create Context Schema

     

    Only the Remove Mapping is displayed as always enabled. The other options are enabled only if they have been defined for the particular element.

  2. To add a context variable click Add button and enter the name of the variable.
  3. Repeat the same steps to create other variables (see Figure 475 ).

    Figure 475: Add Variables

  4. You can also import the context variables of the process flow in which you want to use this mapping activity. To import context variables from process flow, click Import From Process Flow button. Import Context Variable dialog box is displayed (see Figure 476 )

    Figure 476: Import Context Variables

  5. Select the process flow, from which you want to import context variables and click Load.
  6. Click Save.

Load Context Variable

Once you have created the context schema, you need to load it at source or target end depending on your need. 
 

Steps to Load Context Schema Definition

  1. To load the Context Schema at source or target end, click the File menu and then click Load Schema. The Select Schema dialog box is displayed ( see Figure 477).

  2. Select the Context as the schema type. The variables on Context schema are loaded on left panel.

    Figure 477:Load Context Variable

  3. Enable the respective check box to load the Source and/or Target schema.
  4. Click Load.

Map Schema Elements

Once you load the context schema, you can map its variables to elements of other schema (see Figure 478 ).



Figure 478:Map elements

Modify Streaming Properties of Mapping Activity

Once you created the mapping activity using context schema you need to changes its streaming properties while creating process flow using this mapping activity. 
If Context Schema is loaded at source side then there is no need to provide the source (dummy source) stream to the Mapping activity. Similarly if Context schema is loaded at target side then Mapping activity will not generate any output stream, so there is no need to attach dummy target. To achieve thisGenerate Stream and Consume Stream property has been added to Data Mapper activity in the Process Designer. User can disable these properties based on whether Context schema is loaded at source or target side. 
 

Steps to disable input and output stream of mapping activity

  1. While designing the process flow, double click the mapping activity that you have created using context schema definition. Properties of the mapping activity are displayed (see Figure 479 )

    Figure 479:Change streaming

  2. Change the value of Consume Stream or Generate Stream property to false.

    If Context Schema is used at source side, then at run time the actual value of these context variables will be used in the Data mapping. Similarly if Context Schema is used at target side then the output of the data mapping will be parsed and corresponding new value of these context variables will be set.

https://docs.adeptia.com/display/AS/Using+Context+Schema