Skip to Content
author's profile photo Former Member
Former Member

Graphical Mapping issue:context

Hi Gurus,

Have a source structure like

<Header> 1..1

<SourceNode> 1..n

<SourceSubNode> 1..n

<ParameterName>name</ParameterName> 1..1

<ParameterValue>Value</ParameterValue> 1..1

</SourceSubNode>

</SourceNode>

</Header>

<TargetNode> 1..n

<TargetSubNode> 1..n

<TParameterName>name</ParameterName> 1..1

<TParameterValue>Value</ParameterValue> 1..1

</TargetSubNode>

</TargetNode>

The TargetNode should get repeated as many time the following condition is satisfied for for SourceNode

There are atleast 20 non blank 'ParameterName' present in SourceNode.

To achieve the above i have used graphical mapping.Following has been done.

1)Have a written a udf function with two array inputs namely

a)'SourceNode' with context level as Header

b)'ParameterName' with context level as SourceNode

2)The output of the udf function is mapped to CreatIf function which is inturn mapped to TargetNode

Following is the udf:

public void testing(String[] SourceNode,String[] ParameterName,ResultList result){

for(int j=0;j<SourceNode.length;j++)

{

int count=0;

String result1= "false";

for(int i=val;i<ParameterName.length;i++)

if(ParameterName<i>!="")

{

count++;

}

if(count>20)

{

result1="true";

}

result.addValue(result1);

}

Problem:

The ParameterName of first 'SourceNode' are only considered.

When TargetNode2 is to be generated then also ParameterName of first 'SourceNode' is considered,instead of ParameterName of second 'SourceNode'

.

Eg:if there are only 15 non blank ParameterName in first 'SourceNode',then no TragetNode is generated.

Question :How to consider ParameterNames present in 2nd,3rd.. 'SourceNode' to generate corresponding TargetNodes

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Nov 25, 2007 at 05:42 AM

    hi amit,

     String result1= "false";
    for(int i=val;i<ParameterName.length;i++)
    if(ParameterName!="")....
    

    i can't find what the initialization value

     "val" 

    mean

    check your UDF.

    >> mention your codes in [code] to understand better.

    regards,

    nikhil

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 25, 2007 at 06:42 AM

    change the context of the node to

    'SourceNode' with context level as Header

    'ParameterName' with context level as HEADER

    Problem:

    The ParameterName of first 'SourceNode' are only considered.

    When TargetNode2 is to be generated then also ParameterName of first 'SourceNode' is considered,instead of ParameterName of second 'SourceNode'----this might occur becaise the context of the node is revloving arounf the sourcenode only change this to header and try.

    .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.