Author |
Message
|
Bichu |
Posted: Fri Sep 18, 2020 2:35 am Post subject: ESQL Namespace and FIELDVALUE |
|
|
Centurion
Joined: 16 Oct 2011 Posts: 124 Location: London
|
Hello Guys,
I need a help. I am having the below ESQL code to populate a value
Code: |
DECLARE inEnvRef REFERENCE TO Environment.Request;
DECLARE inPolicyRef REFERENCE TO inEnvRef.ns:Policy;
DECLARE outRef REFERENCE TO OutputRoot.SOAP.Body.ns3:parentElement;
DECLARE outPolicyRef REFERENCE TO outRef.ns3:PolicyComplexElement;
SET outPolicyRef.ns504:PolicyNumber = inPolicyRef.ns306:PolicyNumber;
|
After executing these elements PolicyNumber under outPolicyRef is not having any value in the XML tree. I put a file trace after this Compute node and found the below line
Code: |
(0x03000000:PCDataField)http://outputMessageNamespaceGoesHere:PolicyNumber = '8566001794362' (CHARACTER)
(
(0x03000102:NamespaceDecl):xmlns = 'http://inputMessageNamespaceGoesHere' (CHARACTER)
)
|
And when i altered from
Code: |
SET outPolicyRef.ns504:PolicyNumber = inPolicyRef.ns306:PolicyNumber; |
to
Code: |
SET outPolicyRef.ns504:PolicyNumber = FIELDVALUE(inPolicyRef.ns306:PolicyNumber); |
The problem is that i need to give now fieldvalue for 300+ fields. Is it something wrong i am doing on the SET statement I can easily fix or FIELDVALUE is the fix.
And any thoughts on what is happening internally here |
|
Back to top |
|
 |
abhi_thri |
Posted: Fri Sep 18, 2020 3:35 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
hi...
means the whole element/structure will get copied from b to a including attributes of element b and its value.
means you only want to copy the value of element b to a.
so is your intention to copy the whole element as-is or just its value? if it is just the value and it makes sense to use FIELDVALUE so that the intention is clear. |
|
Back to top |
|
 |
Bichu |
Posted: Fri Sep 18, 2020 3:41 am Post subject: |
|
|
Centurion
Joined: 16 Oct 2011 Posts: 124 Location: London
|
My intention is to copy the value here but i have same kind of statements for other fields where the value is getting copied. So wondering why very few elements are not getting copied. |
|
Back to top |
|
 |
abhi_thri |
Posted: Fri Sep 18, 2020 5:14 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
Bichu wrote: |
My intention is to copy the value here but i have same kind of statements for other fields where the value is getting copied. So wondering why very few elements are not getting copied. |
you will only see the difference for complex elements, i.e ones with value and attributes, for simple elements a=b will just do the same as a=FIELDVALUE(b)
can you post the sample input element structure you are trying to copy across, also run the flow user trace which should show what exactly is happening. |
|
Back to top |
|
 |
Bichu |
Posted: Fri Sep 18, 2020 9:12 am Post subject: |
|
|
Centurion
Joined: 16 Oct 2011 Posts: 124 Location: London
|
Thanks for the idea of usertrace.
Below is the usertrace I got.
Code: |
2020-09-18 19:38:12.818626 17044 UserTrace BIP2537I: Node 'com.soa.Application_Name.BuildRequest': Executing statement ''IF outPolicyDTORef.ns504:PolicyNumber IS NULL OR outPolicyDTORef.ns504:PolicyNumber = '' THEN... END IF;'' at ('com.soa.Application_Name_CreateRequest.Main', '535.3').
2020-09-18 19:38:12.818634 17044 UserTrace BIP2539I: Node '': Evaluating expression ''outPolicyDTORef.ns504:PolicyNumber'' at ('com.soa.Application_Name_CreateRequest.Main', '535.7'). This resolved to ''outPolicyDTORef.http://ouputMessageNameSpace:PolicyNumber''. The result was ''''''.
2020-09-18 19:38:12.818640 17044 UserTrace BIP2540I: Node '': Finished evaluating expression ''outPolicyDTORef.ns504:PolicyNumber IS NULL'' at ('com.soa.Application_Name_CreateRequest.Main', '535.42'). The result was ''FALSE''.
2020-09-18 19:38:12.818649 17044 UserTrace BIP2539I: Node '': Evaluating expression ''outPolicyDTORef.ns504:PolicyNumber'' at ('com.soa.Application_Name_CreateRequest.Main', '535.55'). This resolved to ''outPolicyDTORef.http://ouputMessageNameSpace:PolicyNumber''. The result was ''ROW... Root Element Type=16777216 NameSpace='http://ouputMessageNameSpace' Name='PolicyNumber' Value=''''.
2020-09-18 19:38:12.818659 17044 UserTrace BIP2539I: Node '': Evaluating expression ''outPolicyDTORef.ns504:PolicyNumber = '''' at ('com.soa.Application_Name_CreateRequest.Main', '535.90'). This resolved to ''ROW... Root Element Type=16777216 NameSpace='http://ouputMessageNameSpace' Name='PolicyNumber' Value='' = ''''. The result was ''TRUE''.
2020-09-18 19:38:12.818667 17044 UserTrace BIP2539I: Node '': Evaluating expression ''outPolicyDTORef.ns504:PolicyNumber IS NULL OR outPolicyDTORef.ns504:PolicyNumber = '''' at ('com.soa.Application_Name_CreateRequest.Main', '535.51'). This resolved to ''FALSE OR TRUE''. The result was ''TRUE''.
2020-09-18 19:38:12.818677 17044 UserTrace BIP2537I: Node 'com.soa.Application_Name.BuildRequest': Executing statement ''SET outPolicyDTORef.ns504:PolicyNumber = inPolicyRef.ns306:PolicyNumber;'' at ('com.soa.Application_Name_CreateRequest.Main', '536.4').
2020-09-18 19:38:12.818687 17044 UserTrace BIP2539I: Node '': Evaluating expression ''inPolicyRef.ns306:PolicyNumber'' at ('com.soa.Application_Name_CreateRequest.Main', '536.45'). This resolved to ''inPolicyRef.http://inputMessageNamespace:PolicyNumber''. The result was ''ROW... Root Element Type=50331648 NameSpace='http://inputMessageNamespace' Name='PolicyNumber' Value='8566001794362'''.
2020-09-18 19:38:12.818695 17044 UserTrace BIP2568I: Node 'com.soa.Application_Name.BuildRequest': Copying sub-tree from ''inPolicyRef.ns306:PolicyNumber'' to ''outPolicyDTORef.ns504:PolicyNumber''.
|
Copying is successful. But it also says its copying a subtree as well. Will that be a pblm? Because I could see the value in the filetrace as well.  |
|
Back to top |
|
 |
timber |
Posted: Fri Sep 18, 2020 2:21 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
I think I remember this problem.
The issue arises because you have a tag which has both a value and a child node (the namespace declaration). I seem to remember that this causes problems with the default tree-copy algorithm used in the XMLNSC parser. A quick search for 'XMLNSC FIELDVALUE empty' confirms that there have been fixes, but any recent version of IIB/ACE will contain all of the fixes.
Somebody else might remember how to work around this. If not, you may want to ask IBM for assistance. If you do, it will be worthwhile to mention the URL of this thread in the problem description. |
|
Back to top |
|
 |
abhi_thri |
Posted: Sat Sep 19, 2020 3:25 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
Bichu wrote: |
Code: |
This resolved to ''inPolicyRef.http://inputMessageNamespace:PolicyNumber''. The result was ''ROW... Root Element Type=50331648 NameSpace='http://inputMessageNamespace' Name='PolicyNumber' Value='8566001794362'''.
|
Copying is successful. But it also says its copying a subtree as well. Will that be a pblm? Because I could see the value in the filetrace as well.  |
hi...i think that is working as designed, i.e it will copy the whole subtree at input PolicyNumber element including its valid, namespace child and any other subtree under it. In such scenarios if you are just after the value then using FIELDVALUE is the way to go. |
|
Back to top |
|
 |
abhi_thri |
Posted: Sat Sep 19, 2020 3:27 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
timber wrote: |
A quick search for 'XMLNSC FIELDVALUE empty' confirms that there have been fixes |
hi timber...I think the OP is not saying that FIELDVALUE is not working, instead he is expecting 'a=b' to copy just the value of 'b' to 'a' instead of the whole 'b' subtree. |
|
Back to top |
|
 |
timber |
Posted: Sat Sep 19, 2020 3:02 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
@abhi_thri: Are you sure? The initial problem statement seems quite clear to me.
Bichu does not mention the copying of the subtree. He is reporting that the value of inPolicyRef.ns306:PolicyNumber is not being copied at all unless he uses FIELDVALUE. |
|
Back to top |
|
 |
abhi_thri |
Posted: Sun Sep 20, 2020 3:08 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
timber wrote: |
@abhi_thri: Are you sure? The initial problem statement seems quite clear to me.
Bichu does not mention the copying of the subtree. He is reporting that the value of inPolicyRef.ns306:PolicyNumber is not being copied at all unless he uses FIELDVALUE. |
hi timber,
yes, initially he reported that the value is not coming across but that doesn't seems to tie up with the trace output log,
Code: |
(0x03000000:PCDataField)http://outputMessageNamespaceGoesHere:PolicyNumber = '8566001794362' (CHARACTER)
(
(0x03000102:NamespaceDecl):xmlns = 'http://inputMessageNamespaceGoesHere' (CHARACTER)
) |
The trace log suggests that the whole sub-tree is getting copied across including the value.
Later the user trace tells the same story,
Code: |
2020-09-18 19:38:12.818687 17044 UserTrace BIP2539I: Node '': Evaluating expression ''inPolicyRef.ns306:PolicyNumber'' at ('com.soa.Application_Name_CreateRequest.Main', '536.45'). This resolved to ''inPolicyRef.http://inputMessageNamespace:PolicyNumber''. The result was ''ROW... Root Element Type=50331648 NameSpace='http://inputMessageNamespace' Name='PolicyNumber' Value='8566001794362'''.
2020-09-18 19:38:12.818695 17044 UserTrace BIP2568I: Node 'com.soa.Application_Name.BuildRequest': Copying sub-tree from ''inPolicyRef.ns306:PolicyNumber'' to ''outPolicyDTORef.ns504:PolicyNumber''. |
and in the later post he is saying that the copying worked,
Bichu wrote: |
Copying is successful. But it also says its copying a subtree as well. Will that be a pblm? Because I could see the value in the filetrace as well. |
|
|
Back to top |
|
 |
|