05-13-2012 06:39 PM
I want to use the result from Document.GetChildren
to calculate a dynamic folder name.
My idea is that MVEL provide the length of an array via the object method size.
The problem is that I cannot find the right variable which contain the output documents. I know that an operation can return a list of documents or a reference to a list of documents. Nevertheless I don't find the correct variable name ;(
<?xml version="1.0"?>
<component name="org.nuxeo.dev.cookbook.example.pap.process-request.chains">
<extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="chains">
<chain id="CreateDevCookbookExamplePapProcessRequest">
<!--
Input: Called from the folder with all requests
Calculate a name for the new folder
Create folder with title
Create customer_form
Open customer form
-->
<!-- get the folder as input -->
<operation id="Seam.AddErrorMessage">
<param type="string" name="message">Cannot load the folder with the requests.</param>
</operation>
<!-- usually unnecessary -->
<operation id="Context.FetchDocument">
</operation>
<!-- determine number of children -->
<operation id="Seam.AddErrorMessage">
<param type="string" name="message">Cannot calculate the name of the new file.</param>
</operation>
<operation id="Context.SetInputAsVar">
<param type="string" name="name">requests</param>
</operation>
<operation id="Document.GetChildren">
</operation>
<operation id="Context.SetVar">
<param type="string" name="name">form_name</param>
<!--
here I want to calculate a dynamic new file name
BUT: I cannot access the document list from GetChildren.
BUT: It looks like all variable names are unknown.
MVEL: documents.size (should be the length of the list)
-->
<param type="object" name="value">expr:@{Documents.size}</param>
</operation>
The error messages always look like this one:
Caused by: [Error: could not access: Documents; in class: null]
[Near : {... Unknown ....}]
The example is from the tutorial which I prepare for the Dev Cookbook.
05-14-2012 07:48 AM
Hi Michael,
I manage to do it by first setting the input of the getChildren operation as a context variable. Here's a screenshot of my example:
05-14-2012 07:48 AM
05-14-2012 08:40 AM
Hi Laurent,
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.