Guides and Tutorials

Implement the validation logic

Updated: September 28, 2017 Page Information Edit on GitHub

The validation logic defines what happens when the user approves the document, and what happens when he rejects it. To do that, we will create 2 automation chains:

  • The validation automation chain,
  • The reject automation chain.

Validation chain creation

The validation automation chain will be used by the users with validationWorkflow_validation permission, to approve the document. It will:

  • change the lifecycle state of the document,
  • update the validation date property on the document,
  • log a "Spelling review achieved" on the document audit trail.

In this step, we will just create this chain, not adding anything to call it, neither a user action nor an event handler. Actually, the chain will be called if the user "accepts" the document's approval.

To implement the validation chain:

  1. Create the automation chain whose operations and parameters are given below. Don't bind it to any button or event handler, just create the chain.
  2. </ol>
    <p>
        <div class="large reveal" id="image_4a30407f63b04ed0292413a75509dc6a" data-reveal data-animation-in="fade-in" data-animation-out="fade-out">
        <img alt="" src="/assets/60/nxdoc/implement-the-validation-logic/Image 7.png" >
        <button class="close-button" data-close aria-label="Close modal" type="button">
        <span aria-hidden="true">&times;</span>
        </button>
        </div>
        <div class="">
        <img alt="" src="/assets/60/nxdoc/implement-the-validation-logic/Image 7.png" class="nuxeo border thumbnail" data-open="image_4a30407f63b04ed0292413a75509dc6a">
        </div></p>
    

Validation chain parameters

Operation Parameter 1 parameter 2
1 Fetch > Context Document
2 Document > Follow lifecycle transition value: approve _
4 Document > Update property value: @{CurrentDate.days(7).date()} xpath: dc:valid
5 Services > Log Event In Audit event: Document_Validated category: automation

Reject chain

Like the validation chain, the refusal automation chain will be used by the users with validationWorkflow_validation permission, but to reject the document.

To implement the reject chain:

  1. Create the automation chain whose operations and parameters are given below. Don't bind it to any button or event handler, just create the chain.
  2. </ol>
    <p>
    

Reject chain parameters

Operation Parameter 1 parameter 2
1 Fetch > Context Document
2 Services > Log Event In Audit event: Validation_rejected category: automation
2 months ago Manon Lumeau Update installation steps on mac os
5 years ago Benjamin Jalon 18
5 years ago Benjamin Jalon 19
7 years ago Arthur Gallouin 17
7 years ago Arthur Gallouin 16
7 years ago Arthur Gallouin 15
7 years ago Arthur Gallouin 14
7 years ago Arthur Gallouin 13
7 years ago Arthur Gallouin 12
7 years ago Arthur Gallouin 11
7 years ago Arthur Gallouin 10
7 years ago Solen Guitter 9 | format
7 years ago Solen Guitter 8 | added refusal chain
7 years ago Solen Guitter 7
7 years ago Solen Guitter 6
7 years ago Alain Escaffre 5
7 years ago Alain Escaffre 4
7 years ago Alain Escaffre 3
7 years ago Alain Escaffre 2
7 years ago Alain Escaffre 1
History: Created by Alain Escaffre