Extracting the value for PrimaryAddr from the TN profile

I am writing a custom delivery service. I need to determine if this profile using primary protocol or secondary protocol.
How do I extract the Primary address value (PrimaryAddr=true or false).

Use sql to get it from the database itself using the appropriate table query.I am not sure if it helps u.

You can use use the wm.tn.profile:getProfile service the get the profile properties. Then loop over /profile/Delivery and branch on profile/Delivery/PrimaryAddr/MBoolean filed to check if it is true or false. But you also need to define (if you are using different kind of protocols) which protocol you are using. This can also be done with a branch. Or you can use the pub.web:queryDocument service to get these values.

If I do a branch on profile/Delivery/PrimaryAddr/MBoolean it is not working as PrimaryAddr is not a string. but an IData object. Let me try thr sql query part of it.

After the loop the Idata object will change into a record (PrimaryAddr) with a string (MBoolean).

I thought the same way. But it didn’t work. If you have sample service please zip it and send it to me.

According to the TN doc, PrimaryAddr is a Java object (not an IData object). The service doc says it is a java.lang.Integer object. Not sure why they defined the record this way but…

Write a Java service that accepts this object as input. Within the service, retrieve the object from the pipeline and cast it to a java.lang.Integer and return its value as a string. Then you can branch on that.

That sounds promising. I will try that. Thanks for the Info.