cancel
Showing results for 
Search instead for 
Did you mean: 

Node Functions

Former Member
0 Kudos

Hi all,

Can anyone descibe the difference between 2 node functions Remove Context and Collapse Context?

Thnx

View Entire Topic
Former Member
0 Kudos

Hi ;

Remove Context

Use of this Function

We some times face a requirement when we need to pass the values present in different contexts within the same queue to a function. Example being passing the values to a context level User defined function which operates on the values within the same context.

We use removeContexts () to delete all the top level contexts for an element. This removes all top hierarchy levels, so that all elements of the target queue are assigned to a root element of the source queue.

Example:

Source Structure Target Structure

<DT_Source> <DT_Destination>

<Subject> 1…unbound <Total_Marks> 1…1

<Marks/> 1…1 </DT_Destination

</Subject>

</DT_Source>

Mapping Requirement

We need to fetch in all the marks and pass these in same context to a UDF which calculates the total of all these marks.

Mapping

Marks-- Remove ContextUDFTotal_Marks

Here we can see that all the marks coming into the remove Context function are in different contexts and the function has removed the context change and made all the marks come at a same context level.

Split By Value

Use of this Function

The SplitByValue () function is the counterpart to removeContexts(): Instead of deleting a context, we can insert a context change in the source value queue. We then receive this element for each inserted context change instead of a top node element. However, for this to be possible, the top node source field must be assigned a top node target field and minOccurs must be >0. A maximum of minOccurs top node target fields can be inserted here.

We can insert a context change in the queue after each value, after each change to the value, or after each tag without a value.

Example:

<DT_Source> <DT_Destinatio

<Subject> 1…1 <Subject> 1…unb

<Marks/> 1…unb <Marks> 1…1

</Subject> <Subject>

</DT_Source > </DT_Destination>

Mapping Requirement

We need to split out the marks values in the source structure to different contexts in the target structure.

Mapping

Marks-- SplitByValue--Marks

Here we can see that the marks coming in the Split By Value

Function are in the same context and this function is splitting out the marks values to different contexts.

Mudit