messagebroker - IBM Integration Bus: How to read user defined node (Java) complex (table) property in Java extension code -



messagebroker - IBM Integration Bus: How to read user defined node (Java) complex (table) property in Java extension code -

i created java user defined node in integrationtoolkit (9.0.0.1) , assigned several properties. 2 of node properties simple (of string type) , 1 property complex (table property predefined type of user-defined) consisted of 2 simple properties. next documentation able read 2 simple properties in java extension class (that extends mbnode , implements mbnodeinterface) making getters , setters match names of 2 simple properties. documentation states getters , setters should homecoming , set string values whatever real simple type of property may be. obviously, not work complex node property. able read user defined properties defined on message flow level, using cmp (integration buss api) classes, impossible thing user defined node without cmp. @ 1 point began think complex property among user defined properties, (although udps defined on flow level , property defined on custom node level) based on other random documentation , other forum discussion. deduced complex property should map mbtable type (as stated in type's description), not able utilize that. know how access user defined node's complex(table) property value java?

i started working websphere message broker v 8.0.0.5 1 of projects , going inquire same question until suggested question answered question. might little late question may help others having similar questions.

after many frustrating hours consulting ibm documentation found next thread:

you're right properties beingness available user-defined properties (udp) @ node level.

according javadoc mbtable class (emphasis added phone call out relevant parts):

mbtable complex info type contains 1 or more rows of simple info types. construction similar * standard java record set. can not constructed in node instead returned getuserdefinedattribute() on mbnode class. primary utilize in allowing complex attributes defined on nodes instead of normal static simple types. can used in runtime if version of toolkit supports complex properties beingness used.

you have phone call com.ibm.broker.plugin.mbnode.getuserdefinedattribute homecoming instance of com.ibm.broker.plugin.mbtable. however, broker runtime doesn't phone call setter methods complex attributes during node initialization process simple properties. also, cannot access complex attributes in either constructor or setter methods of other simple properties in node class. these available in run or evaluate method.

the next decompiled method definition of com.ibm.broker.plugin.mbnode.getuserdefinedattribute.

public object getuserdefinedattribute(string string) { object object; string string2 = "adddynamicterminals"; if (trace.ison) { trace.lognamedentry((object)this, (string)string2); } if ((object = this.getuda(string)) != null && object.getclass() == mbelement.class) { seek { mbtable mbtable; mbelement mbelement = (mbelement)object; object = mbtable = new mbtable(mbelement); } grab (mbexception var4_5) { if (trace.ison) { trace.logstacktrace((object)this, (string)string2, (throwable)var4_5); } object = null; } } if (trace.ison) { trace.lognamedexit((object)this, (string)string2); } homecoming object; }

as can see returns instance of mbtable if attribute found.

i able access complex attributes next code in node definition:

@override public void evaluate(mbmessageassembly inassembly, mbinputterminal interminal) throws mbexception { checkuserdefinedproperties(); } /** * @throws mbexception */ private void checkuserdefinedproperties() throws mbexception { object obj = getuserdefinedattribute("geolocations"); if (obj instanceof mbtable) { mbtable table = (mbtable) obj; int size = table.size(); int = 0; table.movetorow(i); (; < size; i++, table.next()) { string latitude = (string) table.getvalue("latitube"); string longitude = (string) table.getvalue("longitude"); } } }

the documentation declaring attributes user-defined extensions in java surprisingly silent on little bit of detail.

please note references , code websphere message broker v 8.0.0 , should relevant ibm integration bus 9.0.0.1 too.

messagebroker

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -