cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow autoStart

Ovidiu_Detesan
Champ in-the-making
Champ in-the-making

Hello,

Is there any way to make a workflow autostart, once a form is filled or a document is uploaded, that will be a serial approval workflow and if all, in this example 3 approvers accept the document gets moved to a separate folder ?

Or something similar, I am looking for a tutorial, as this is the first time I am using nuxeo and am still unfamilliar with it.

Thank you for you help.

Ovidiu

2 REPLIES 2

ssze_
Star Contributor
Star Contributor

Hi,

what you are looking for is basically the process described here:

https://doc.nuxeo.com/display/NXDOC/How+to+Set+a+Default+Date+on+a+Field+at+Document+Creation

You can use an event handler like this:

 <extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="event-handlers">
    <handler chainId="ApprovalWorkflowChain">
      <event>documentCreated</event>
      <filters>
        <doctype>TestDoc</doctype>
      </filters>
    </handler>
  </extension>

Then you have the automation chain starting the workflow:

<extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="chains">
   <chain id="ApprovalWorkflowChain">
      <operation id="Seam.GetCurrentDocument"/>
      <operation id="Context.StartWorkflow">
        <param type="string" name="id">MyApprovalWorkflow</param>
        <param type="boolean" name="start">true</param>
      </operation>
    </chain>
</extension>

In the workflow you can also call an automation chain to move documents:

You can just call your three person approval workflow there. In there you can call automation chains to move documents like this:

<extension target="org.nuxeo.ecm.core.operation.OperationServiceComponent" point="chains">
    <chain id="approved">
      <operation id="Seam.GetCurrentDocument"/>
      <operation id="Document.SetLifeCycle">
        <param type="string" name="value">approved</param>
      </operation>
      <operation id="Document.Move">
        <param type="document" name="target">/asset-library/Approved</param>
        <param type="string" name="name">expr:Document.name</param>
      </operation>
      <operation id="Seam.NavigateTo">
        <param type="string" name="view">expr:Document.id</param>
      </operation>
    </chain>
</extension>

Hope this helps you.

Ovidiu_Detesan
Champ in-the-making
Champ in-the-making

Thank you for your answer ssze, I will test it out in the next weeks to come and update here if all is ok.

Getting started

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.