Error when tying to get a field value from a object in process activity

358 views
Skip to first unread message

yoke-le...@lafargeholcim.com

unread,
Jan 24, 2018, 7:24:19 AM1/24/18
to Fujitsu RunMyProcess Developer Community
In my application process, I have an activity to generate a letter in pdf and to put the name of Head of Department user name in the letter. The Head of Department name is in a collection "My_col". In the activity process, I want to grab the name of Head of Department from collection and send the data for pdf generation.

I tried to use the below coding <#assign CCHead = ...> to get the head of department value but got error "Expected hash. tmp evaluated instead to freemarker.template.SimpleSequence on line 4, column 19 in |techno=freemarker|.
"

<#assign tmp = inject_objects(list_objects({},"My_col"))>
${tmp}

<#assign CCHead = tmp.head_of_credit_and_hr_managemnet>
${CCHead};

{"my_var_main":{"var_1":"${bank_name}","var_2":"${address_1}","var_2.1":"${address_2}","var_2.2":"${address_3}","var_2.3":"${address_4}","var_4":"${collateral_amount}","var_5":"${to_str}","var_6":"${legal_entity}","var_7":"${CCHead}","var_8":"${current_date_str}","var_9":"${customer_name}","GotCollaAmt":"${checking_amount}","ICno":"${ic_no}","CollaIssueDt":"${signature_date_str}",}}

collection data.png
Expected hash error.png

Prachi Chandak

unread,
Jan 24, 2018, 1:35:36 PM1/24/18
to Fujitsu RunMyProcess Developer Community
Hello,

Please check the syntax used in above code. The result from collection is in array format.
So according to code you should use the below code-

<#assign tmp = inject_objects(list_objects({},"My_col"))>
${tmp}
<#assign CCHead = tmp[0].head_of_credit_and_hr_managemnet>
${CCHead}; 

If you want to iterate complete array. Then, you can use <#list tmp as x>....</list> 

Please let us know if you need more assistance.

Thanks & Regards,
Prachi Chandak
Fujitsu RunMyProcess Support


--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/8bd7ce08-7091-41e3-8227-55cdc8f6038c%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.

yoke-le...@lafargeholcim.com

unread,
Jan 25, 2018, 4:33:22 AM1/25/18
to Fujitsu RunMyProcess Developer Community, yoke-le...@lafargeholcim.com
Good day Prachi,

Thank you very much. It is working now.

Reply all
Reply to author
Forward
0 new messages