on 09-29-2008 4:11 AM
Hello Friends ...
Please help me out in this logic.
If i am having the sender and receiver structure as follows.
Source Structure
<src1>
#####<src2> (1 to unbounded)
##########<src3>
##########<src4>
##########<src5>
##########<src6>
#############<src7> (1 to unbounded)
#################<field1>
#################<field2>
In source Structure src3, src4, src5, src6 are of same level and fld1 and fld2 are also of same level and under "src7" node.
Receiver structure
<rcv1>
#####<rcv2>
##########<rcv3>
##########<rcv4>
here i am facing the problem -
the <field1> in receiver structure can have the values of "Y" or "N" under different <src7> nodes. but in the receiver structure the <rcv2> needs to be created only when the <field1> value is "Y". I mean
If the source structure is as below
<src1>
#####<src2> (1 to unbounded)
##########<src3>
##########<src4>
##########<src5>
##########<src6>
#############<src7>
#################<field1> "N"
#################<field2>
#############<src7>
#################<field1> "Y"
#################<field2>
#############<src7>
#################<field1> "N"
#################<field2>
#############<src7>
#################<field1> "N"
#################<field2>
#####<src2> (1 to unbounded)
##########<src3>
##########<src4>
##########<src5>
##########<src6>
#############<src7>
#################<field1> "N"
#################<field2>
#############<src7>
#################<field1> "N"
#################<field2>
#############<src7>
#################<field1> "N"
#################<field2>
#####<src2> (1 to unbounded)
##########<src3>
##########<src4>
##########<src5>
##########<src6>
#############<src7>
#################<field1> "N"
#################<field2>
#############<src7>
#################<field1> "N"
#################<field2>
#############<src7>
#################<field1> "Y"
#################<field2>
#############<src7>
#################<field1> "N"
#################<field2>
#############<src7>
#################<field1> "Y"
#################<field2>
Then The receiver structure needs to be like this
<rcv1>
#####<rcv2>
##########<rcv3> "Y"
##########<rcv4>
#####<rcv2>
##########<rcv3> "Y"
##########<rcv3> "Y"
##########<rcv4>
The <rcv2> needs to be created only when <src2> exists and the <field1> value in that perticular context is "Y"
As here the value of <field1> is "Y" in two instances of <src2>. I mean first instance of <src2> is having the <field1> value as "y" and third instance of <src2> is having the <field1> value as "y" but second instance of <src2> is not having atleast one value of <field1> value as "y" so we need to get the <rcv2> only two times for those intances of <src2> having <field1> value as "y" .
Please help me out in achieving this .
Thanks
Ramana.
Hi Ramana,
if <feild1> is "Y" and <src2> exists
<feild1> ->equals->[CONSTANT "Y"] and <src2> -> exists -> IfWithoutElse[Keeps=true]-><rcv2>
Thanks,
Sunil Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramana,
You are stuck with context Assignment.
if <feild1> is "Y" and <src2> exists
<feild1> ->equals->[CONSTANT "Y"] and <src2> -> exists -> IfWithoutElse[Keeps=true]-><rcv2>
in this you will have to fulfil 2 condition one is <Feild1> shld be "Y" and <src2> shld exists.
keep the context of <feild1> and <src2>( right click on <feild1>) to Message level (not <src7> level) and then chck if value "y" is coming & "and" (BOOLEAN) this with <src2> exists.
Thanks,
Sunil Singh
Hi Sunil,
HereOur logic is not working fine. As it is comparing this <src1 existance :3> existance value to <field1> (existance :12) its creating 3 nodes on the receiver side. where as our requirement is 2. i tried with all the possiblities of contexts combination eith the node as well as field. Hope we need to change our logic itself.
Think one more time sunil. Thanks for your patience.
Regards.
Hi,
Better try this
src2--------->exists---\
and
field1---------------------\
equalsS------>Createif--->rcv2
Constant[Y]----------/
Map field1 to rcv3
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There is no need to check for the existence of src2 since its occurrence is 1..unbounded.
You can use this mapping to eliminate the three nodes problem:
field1 (set context to src2) --> sort:lexicographical(case insensitive) --> collapseContext --> *sort:lexicographical(case insensitive) --> splitByValue:valueChanged --> rcv2
explanation:
When you use the first sort, it makes the value Y at the top of the queue, so when you use collapseContext, only single Y and N values exists..so the output should now be Y,N,Y. Then you use the second sort to make it Y,Y,N, then use splitByValue so that only the values YY gets included in the 0..unbounded occurrence when using the Test tab...It will create rcv2 nodes if and only if the queue contains a Y
The mapping is still incomplete though, as you would have to find a way to map src3
Let me know if this helped
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.