Originally posted by: SystemAdmin
Hi everybody,
I'm trying to use the java adapter in WTX 8.2 and I am having a problem with it.
I have a class that has an attribute with a Java.Array (I have the same problem with every non-primitive type from the JRE) and I have to map fields from an xml to this attributes to output a Java object. The problem is that in the type tree, that attribute appears as ref.AttributeName, so I would have to put an ID in that field's rule.
But should I create a tree for each one of these classes that belong to the JRE so I can assign an id to them later in the map? This sounds wrong to me, because these classes have other non-primitive classes inside and this may never end. Besides, mapping all the necessary elements for each one of these trees would probably be impossible.
The data we're getting back is coming in as numerous ref.nnnnnn strings which we must then pass to another map in order to extract the data from the pool associated with that ref#. In other cases, the data returned is the actual string. Since there are a large number of classes involved, we'd like to just get the string and not have to pass ref data to another map. Can anyone tell us what to do to make this happen. Is it the manner in which the tree is built? We are importing classes to create the trees.
Is there another way of doing this? How can I map the values to these JRE classes?
I could not find then this from WTX help:
As per the help:
Java-based applications that invoke a map through the API can also take advantage of using the Java Class Adapter to access additional Java objects. For EJB functionality, access to serializable objects is supported. From the user’s Java Application or EJB, objects are serialized using Java Serialization and passed (using a STREAM adapter override) to input cards of a map. Within the map, the Java Class adapter can be used to deserialize an object (and store it in the Object Pool). Access to fields and methods on Objects stored in the Object Pool is permitted using the Java Class adapter. (Objects are also accessible using the CORBA, JNDI, and JMS adapters.) To pass objects back to the user’s application from a map, objects are serialized using the Java Class adapter. The resulting byte[] is passed back to the calling EJB using a STREAM adapter override. The Java application or EJB re-constructs the Object using Java Serialization.
Thanks in advance
Kodanda
#DataExchange#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender