Other types than String in Document Types

Hello,

it seems Broker can use various types like SHORT, INTEGER, LONG, FLOAT and others but Document Type works with String only.

Is there any way to consume Documents with these “special Broker types” on Integration Server?

Thanks

Yes, define them in an IS document type as an object, then on the properties pane select the appropriate wrapper type.

I would advise, however, that an approach using string data types is generally easier to manage and maintain. Strong typing in integration components usually is not necessary. As a rule of thumb, I define all fields as strings unless there is a specific, immediate reason to use another type. One exception I often make to this is for date fields. I convert them to java.util.Date, usually. Or to a standard string format like the W3C format.

Hi,

I agree with Reamon, it is easier to keep String.
But I faced one peculiar problem when using MWS Tasks.

The task search result table sorts data as per the data type. Hence we should define actual data type for the fields to be used as task input/output, else the sorting does not work as required.

Regards,
Sumit

Hi Reamon,

I have a question. I have a requirement where I need to insert a date field into tera-data database. The target field is defined as DATE type which is java.sql.Date.

So, I get the date in a string field and If I map directly to the Object type(target date field) in the adapter Service, it is not inserting those values and giving error.

But if I transform the string to Date type using StringToDate in WmTransformers. I was able to insert.

So, My question is that is there another way to insert without using transformations.

Please let me know your thoughts!

Thanks,
David.

Change the adapter service to accept a string for the DATE column. As long as you pass a format expected by the DB it will do the conversion for you.

Hi Reamon,

I have changed the input type of the date field to “java.lang.String”. But when I tried to insert using the adapter service. It is giving me this error.

[ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service XXXX.XX
[ADA.1.314] Cannot set data for the input field “StartDt”

Do I need to contact the table owner to set the input type to accept the string types?? Please suggest.

Thanks,
David.

Hi reamon,

I was able to figure out the solution. Basically, I am trying to insert MM/dd/yyyy but the target is not accepting. But if i give the format as yyyy-MM-dd, then i was able to insert.

May be its restricting formats.

Thanks,
David.

Right. The format is whatever the default string format is for the DB.