Document to DocumentList working ?

hi,

I try to make this conversion. I made it within a Java service and it works well.
But, can you tell me how you would do that with a Service Flow (and/or with the help of the existing documentToDocumentList service) please ?

Input :
customer

  • id
  • name

Output :
customer[0]

  • id
  • name

if Input is already a list, the task make nothing and leave the list as it.

Regards

Hi,

Really no idea on how to do that without a java service ?

Make a branch, check for customer[0]/id (this is a check whether you already have a list as input).

If it’s not NULL, do nothing.

If it’s NULL, do an explicit mapping from the customer object to a temp. doc list. Then drop the customer doc, then map the temp. doc list as the doc list “customer”.

Thanks, but i would hope doing that without a branch tests…
In a more generic way, just with an existing function WebMethods service…
Because the Java service I’ve created is really simple, I would think such a service already exists… is it not the case?

I don’t think such a service exists. I assume, in your java service you also use some kind of “if”. Why is a branch a problem for you? Once you’ve implemented the service noone will know or will be interested in how it works. The important thing is that it “just works.”

Yes, you’re right :slight_smile:
Thanks for your help

If you input is a list, did you try loop over and then pass through. As per the BIS, A document containing these three keys:

Key Value
cx_timeout 1000
cx_max 2500
cx_min 10

Would be converted to a document list containing these three documents:

pName cx_timeout
pValue 1000

pName cx_max
pValue 2500

pName cx_min
pValue 10

Thanks M@he$h, I kept my java service and all work well.