We want people from the group "validators" to be able to change the lifecycle state of the document to "valid". When doing this, we expect some actions to be automatically run:
- Storing the date of validation on the document itself, in
dc:valid
metadata; - Storing a pdf transformation of the file on the document itself, so that users don't have to rely on the dynamic transform service to get the file (this will be needed too when we will make the document go from "revision" state back to "valid");
- Storing on the document the version of the module at the time the document is validated, so that we always know for which version of the module the document was relevant.
Validation action will be displayed as an icon on the contextual actions of the document, on the right upper side of the screen, beside print, email and zip export actions. Here is the result of the validation we want to achieve on the document's metadata:


To implement the validation chain:
- Declare the action by clicking on User Actions in the Studio tree (see also how to create a new action).
- Fill in the filtering information.
In our sample, we want to display the button when the following conditions are met:
- the current document is of type "DocumentationItem",
- it is a regular document
- its lifecycle is "draft"
- the user is a member of the group "validators":
- Create the corresponding automation chain.
As we need to reuse the conversion of the
content:file
blob into pdf and storing of it as a blob inpdf_version
field when we make the document go from "revision" back to "valid", we actually create two chains here:- a PDF conversion chain,
- a validation chain, that executes the PDF conversion chain at some point.
See below for each chain configuration.
The pdf conversion subchain parameters
N° |
Operation |
Parameter 1 |
parameter 2 |
---|---|---|---|
1 |
Fetch > Context Document |
_ |
_ |
2 |
Push and Pop > Push Document |
_ |
_ |
3 |
Files > Get Document File |
xpath: |
_ |
4 |
Files > Convert to pdf |
_ |
_ |
5 |
Context > Set variable from input |
name: |
_ |
6 |
Push and Pop > Pop Document |
_ |
_ |
7 |
Document > Set File |
file: |
xpath: |
The input and output of some of the operations (3,4,5) handles a different type: "Blob". If you don't order well the elements, it will alert you by coloring the operation in red. See the Operation flow - input and output typing page.
The validation chain parameters
N° |
Operation |
Parameter 1 |
parameter 2 |
---|---|---|---|
1 |
Fetch > Context Document |
_ |
_ |
2 |
Document > Follow lifecycle transition |
value: |
_ |
3 |
Chain execution > Run document chain |
id: |
_ |
4 |
Document > Update property |
value: |
xpath: |
5 |
Push and Pop > Push Document |
_ |
_ |
6 |
Document > Get Parent |
type: |
_ |
7 |
Context > Set context variable |
name: |
value: |
8 |
Push and Pop > Pop Document |
_ |
_ |
9 |
Document > Update property |
value: |
xpath: |
In Validation chain step 3 we call the subchain that operates the PDF conversion.