how to set property list in automation chain?

Hello,

I have the simple property

<xs:element name="para">    
<xs:simpleType>    
<xs:list>        
<xs:simpleType>            
<xs:restriction base="xs:string" ref:resolver="userManagerResolver" ref:type="user"/>        </xs:simpleType>    
</xs:list>    
</xs:simpleType>
</xs:element>

Then in the automation chain:

<chain id="setPara">    
<operation id="Document.SetProperty">        
<param type="string" name="xpath">doc_base:para</param>        
<param type="boolean" name="save">true</param>        
<param type="serializable" name="value">expr:Context["workflowInitiator"]</param>    
</operation>
</chain>

When I execute the chain, output the next error:

Name: setPara Exception: OperationException Caught error: Only scalar types can be set using update operation Caused by: org.nuxeo.ecm.automation.OperationException: Only scalar types can be set using update operation

The value for workflowInitiator is: | Key: state, Value: ready | Key: workflowInitiator, Value: pedro |

Any suggestion for set the property?

Regards! Gabo

0 votes

1 answers

130 views

ANSWER



Have you tried with “stringlist” type?

0 votes



Hello ioihanguren, Yes I tried with “stringlist” type, but not working. The same error message output in the log
04/27/2022

I don't know if it is the best way to do it, but I think the problem is that you are setting just one username and you need a list. Probably there is a better / easier way to do that with MVEL, but I think that this should work:

&lt;param type=&quot;stringlist&quot; name=&quot;value&quot;&gt;expr:Fn.concatenateValuesAsNewList(Context[&quot;workflowInitiator&quot;])&lt;/param&gt;

If it doesn't, I'm sorry I can't help. Hopefully someone with more experience with chains and MVEL will.

Good luck!

04/28/2022