Expand my Community achievements bar.

SOLVED

How to Pre-Populate the user information during Assign Task operation

Avatar

Level 2

Hi ,

I have a requrirement to Pre-Populate the form fields (Name, Email, Phone etc...) when a task is assigned to a user. The users are dynamically assiged, so I am using the Find User and the Assign Task services to locate and assign the task to the user. Since I have a User variable that is a result from the Find User operation, I was hoping to retrieve the user information with the attributes of the User type.

I tried to use the Set Value service to set the form field (Email) with the email attribute of the User object type i.e.

/process_data/MyForm/object/data/xdp/datasets/data/Form/User/Email   ->  /process_data/facilityAuthority/object/@email

However I get the following error when I try to do this - com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: [B@335d of type: [B to type: interface org.w3c.dom.Document.

Is it possible to retrieve the user information from the User object? If so how do I get the values for the User attributes (Name, Email & Phone etc...) so that I can populate them in the form?

Thanks,
Samanthapudi

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi,

Please type cast email into string before assigning.

Example

/process_data/MyForm/object/data/xdp/datasets/data/Form/User/Email   -> string(/process_data/facilityAuthority/object/@email)

For more details please refer to forum http://forums.adobe.com/thread/492826

Thanks

View solution in original post

3 Replies

Avatar

Correct answer by
Level 3

Hi,

Please type cast email into string before assigning.

Example

/process_data/MyForm/object/data/xdp/datasets/data/Form/User/Email   -> string(/process_data/facilityAuthority/object/@email)

For more details please refer to forum http://forums.adobe.com/thread/492826

Thanks

Avatar

Former Community Member

Hi AnkitY,

I am having a same problem and could not make it work right. Do you have a sample workflow for this, could you please post it here to share? I appreciated

it much.

Thanks a lot,

Han Dao

Avatar

Level 3

Hi Han Dao,

If you are facing an exception of the form "com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: [B@335d of type: [B to type: interface org.w3c.dom.Document.", It is because the system is trying to cast a Byte Stream into w3c Document and failing. To resolve this we can explicitly cast this byte stream to appropriate data type (String in previous example). To do so we can use a SetValue operation.

As an example

Setting

/process_data/MyForm/object/data/xdp/datasets/data/Form/User/Email   -> /process_data/facilityAuthority/object/@email
results in the exception

so we can modify it to

/process_data/MyForm/object/data/xdp/datasets/data/Form/User/Email   -> string(/process_data/facilityAuthority/object/@email)

Please let me know if this does not resolve your issue.

Thanks