Create fallback for visual signing

This scenario requires PAS 5.1.0 or higher

Some clients wants to enable the PADESSignVisibleSignatureValve to include visual signatures into their documents. However, since the visual trail page is limited to one page, the signature might not fit if the signatures take up too much space or that they are too many. Another usecase could be that the document is already signed and therefore no trailing page can be added. In those cases, you can use PADESSignValve, a non-visual version of PADESSignVisibleSignatureValve, as a fallback for the visual signing.

How it works

To enable the PADESSignValve fallback, it should be placed after the PADESSignVisibleSignatureValve in the pipe. The PADESSignVisibleSignatureValve should get two properties:

  • proceed_on_error: true
  • fail_property: my-property-name

This means that if the PADESSignVisibleSignatureValve fail because there is no more room on the visual trail page (or any other reason), the pipe will still continue because of the proceed_on_error property.

To enable the fallback, add the PADESSignValve next, but in order to not create two signatures for each signature that can be fit into the visual trail page, we need to add a property to the PADESSignValve:

  • exec_if_expr: flow.getPropertyValue('my-property-name', 'false').equals('true')

This makes the PADESSignValve only execute if 'my-property-name' equals to true (we default to false in the second input parameter into the getPropertyValue function). We set 'my-property-name' to true when setting the fail_property in the PADESSignVisibleSignatureValve in the previous step. We will only set to true if the PADESSignVisibleSignatureValve fails, otherwise we do not set it at all (it is null).

Example configuration

This text assumes you have already set up a working pipe for visual PAdES signing

{
  "name": "PADESSignVisibleSignatureValve",
  "enabled": "true",
  "config": {
  	"keyStoreID": "{{item.keyStoreId}}",
    "pdfSourceData": "{{item.temporary}}",
    "pdfTarget": "document",
    "proceed_on_error": "true",
    "fail_property": "if_no_visual"
  }
},
{
  "name": "PADESSignValve",
  "enabled": "true",
  "config": {
  	"keyStoreID": "{{item.keyStoreId}}",
	"pdfSourceData": "{{item.temporary}}",
	"pdfTarget": "document",
	"exec_if_expr": "flow.getPropertyValue('if_no_visual', 'false').equals('true')"
  }
} 
Click to copy