TN Profile Insertion

Hello experts,

I am facing a small problem while creating Profile using services in developer.

This is the flow tha I am following to create Partner in TN:

pub:file:getfile (which picks a particular file)
pub:flatFile:convertToValues (parses the file with the schema which I created to recognize flatfiles)
wm.tn.profile.create.newExternalID
MAP (here I populate values into ‘ExternalID’ from my document which I parsed previously)
wm.tn.profile.create.newContact
MAP (here I populate values into ‘Contact’ from my document which I parsed previously)
wm.tn.profile.create.newDelivery
MAP (here I populate values into ‘Delivery’ from my document which I parsed previously)
wm.tn.profile.create.newProfile
MAP (here I populate values into ‘Profile/Corporate’ and values which are in pipeline{Delivery,ExternalID,Contact} from my document which I parsed previously)
wm.tn.profile.create.addProfile

This is the flow that am following to create a Profile in TN.
When I run this flow then the Profile is being created in TN with an exception which says,

‘Error encountered invoking wm.tn.profile:addProfile java.lang.ClassCastException: java.lang.String.’ Though the other values are not being created it just shows ‘Corporation name’ in TN.

Now if I hardcord the values and run my map then It is creating and saving all the values in TN perfectly.
May be there might be few services which I have to add (which am not sure, as I read TNBIServices guide it explains me the services not the sequence or flow).

Any help would highly appreciated

Awaiting Response,
raffim

One of the frustrating things about many of the wM-supplied services is that sometimes they expose objects via the pipeline using IData structures (the “normal” pipeline stuff). Other services sometimes expose only raw objects that are not IData, but Developer displays them as though they are. It can be very confusing and aggravating.

I’m not sure exactly, but I think one or more of the “newXXXX” services is creating an object that isn’t the right kind of object for the addProfile service–thus causing the class cast exception.

If addProfile is working when hard-coding the values, then skip the “newXXXX” services and just use newProfile and addProfile with the values you read from disk.

Thanks for your quick response reamon.

The problem is resolved now.

I was trying to pass string into integer, so was the error encountering.
There are few IDType/Type fields which are defined as objects (java.lang.integer/short/long). I hardcoded them as per my requirement.

But still If I convert string to bytes & pass the values the error is encountering, want to get rid of that.

Thanks all,
Raffim :slight_smile:

What are converting to bytes? And why?

Hi,

sorry for the late response.

My question was, I have a string value in pipeline-in and I have to map it to an ‘idtype’ which is an ‘object’ and has prop as java.long.short/long/etc.

So was trying to convert my string to suitable format.

thanks in Advance,
Rafi