Author |
Message
|
SOLOHERO |
Posted: Tue Sep 01, 2009 12:45 am Post subject: Properties in JavaComputeNode |
|
|
Centurion
Joined: 01 Feb 2007 Posts: 107
|
Hi Guys,
Could some one tell how to set the properties in javaCompute node..
i want some thing like this we do in esql..but how to do in java compute.
SET OutputRoot.Properties.MessageSet = 'HDO1';
SET OutputRoot.Properties.MessageType = 'MyName';
SET OutputRoot.Properties.MessageFormat = 'XML1';
Thanks _________________ Thanks |
|
Back to top |
|
 |
Gaya3 |
Posted: Tue Sep 01, 2009 1:15 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
Build an Mbelement for properties which creates the first child for properties
properties.createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "MessageSet","HDO1");[/b] _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
SOLOHERO |
Posted: Tue Sep 01, 2009 5:25 am Post subject: |
|
|
Centurion
Joined: 01 Feb 2007 Posts: 107
|
Thanks for the reply..i was trying that but what is the statement for output. _________________ Thanks |
|
Back to top |
|
 |
jbanoop |
Posted: Tue Sep 01, 2009 6:06 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
that is the statement for output ..
create an out message of type MBMessage and on that get the root element and then create a child for properties. Then go ahead and create the fields of the properties as mentioned above.
Have a look at the documentation as well as the Java API. It is pretty straightforward. |
|
Back to top |
|
 |
SOLOHERO |
Posted: Tue Sep 01, 2009 4:43 pm Post subject: |
|
|
Centurion
Joined: 01 Feb 2007 Posts: 107
|
i was trying the below code
MbElement mType = outMessage.getRootElement();
MbElement prop = mType.createElementAsFirstChild("Properties");
prop.createElementAsLastChild(MbElement.TYPE_NAME_VALUE,"MessageType","HLDType");
but i am getting the following error...
RecoverableException
File = F:\\build\\S600_P\\src\\DataFlowEngine\\ImbMessageGroup.cpp
Line = 181
Function = ImbMessageGroup::createParser
Type = ComIbmJniNode
Name
common/test/TestSaxon9Transform#FCMComposite_1_4.common/Saxon9XSLTTransform_sub#FCMComposite_1_1
Label = common.test.TestSaxon9Transform.Saxon9XSLTTransform_sub.Saxon9Transform
Catalog = BIPv600
Severity = 3
Number = 2310
Text = Could not create parser
Insert
Type = 5
Text = PROPERTIES _________________ Thanks |
|
Back to top |
|
 |
SOLOHERO |
Posted: Tue Sep 01, 2009 5:46 pm Post subject: |
|
|
Centurion
Joined: 01 Feb 2007 Posts: 107
|
Hi Guys..i got it working using the below code..
MbMessage outMessage = new MbMessage();
MbElement mSet = outMessage.getRootElement().getFirstElementByPath("Properties/MessageSet");
mSet.setValue("HLDType");
problem with below statement is
properties.createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "MessageSet","HDO1");[/b]
it is creating another field called MessageSet under MessageSet.
since the field messageSet already exists in the root we just have to assign the value to it and not to create..
Thanks for all the suppoort.... _________________ Thanks |
|
Back to top |
|
 |
SOLOHERO |
Posted: Tue Sep 01, 2009 10:08 pm Post subject: |
|
|
Centurion
Joined: 01 Feb 2007 Posts: 107
|
i got another problem here....in setting the encoding and ccsid in MQMD.
As u guys know they are type int.
how can i set a value to those fields..
if i am using the below statement it wont allow cause set value will take only string and i can see the value getting changed in the mqmd--encoding but when validating it throws cast exception.
note encoding is user defined value....
MbElement encod = outMessage.getRootElement().getFirstElementByPath("Properties/Encoding");
encod.setValue(encoding);
i tried using setSpecificType()..after parsing encoding to int but i cant see anyvalue .being set to encoding fied ...could some one guide me how and where am i going wrong..
MbElement encod = outMessage.getRootElement().getFirstElementByPath("Properties/Encoding");
encod.setSpecificType(encoding);
Thanks
Thanks _________________ Thanks |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Wed Sep 02, 2009 12:54 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
I've answered this last bit in your other thread.
If you had posted in here first and wanted it moved you should have asked a moderator but dont paste the question lots of times please. |
|
Back to top |
|
 |
|