ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Properties in JavaComputeNode

Post new topic  Reply to topic
 Properties in JavaComputeNode « View previous topic :: View next topic » 
Author Message
SOLOHERO
PostPosted: Tue Sep 01, 2009 12:45 am    Post subject: Properties in JavaComputeNode Reply with quote

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
View user's profile Send private message Send e-mail
Gaya3
PostPosted: Tue Sep 01, 2009 1:15 am    Post subject: Reply with quote

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
View user's profile Send private message
SOLOHERO
PostPosted: Tue Sep 01, 2009 5:25 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jbanoop
PostPosted: Tue Sep 01, 2009 6:06 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
SOLOHERO
PostPosted: Tue Sep 01, 2009 4:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
SOLOHERO
PostPosted: Tue Sep 01, 2009 5:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
SOLOHERO
PostPosted: Tue Sep 01, 2009 10:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
WMBDEV1
PostPosted: Wed Sep 02, 2009 12:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Properties in JavaComputeNode
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.