Implement Confirmation Pages

This article describes how you can implement the configuration pages feature of Meridian Enterprise 2020 R2.

Other articles about confirmation pages:

Use case

When moving a document in workflow the system normally checks whether all mandatory references are available in Meridian, and that the loop number is set. This feature allows a normal user or a super user to proceed through a document workflow even when the mandatory references are missing. When references are missing, the missing document classification is shown.

Super users can:

  • ignore the mandatory references check for the entire batch without specifying a reason.
  • enter a default loop number for all documents in the batch.

Normal users can proceed with the workflow if the document has missing mandatory references, but must enter a reason.

When a document is moved through a workflow and mandatory references are missing:

  • A log entry is created.
  • If the loop number is missing, you can enter it, but also proceed without entering it.

At the end of the batch, documents with missing loop numbers are listed.

Implement the sample configuration

You can download Confirmation Pages.zip, which contains a .met file with a sample implementation you can use.

You can import the .met file to an empty vault. No external components are required.

Specify required references

On the Process tab that appears when you select a document, you can specify the references that are required for the document to progress through the workflow.

To specify the required references for a document:

  1. In the Missing references field of the Process tab, enter the references that you want the system to check for when the document moves through the workflow.
  2. Clear the is super user check box if you want users to enter a reason before proceeding with a workflow if the document has missing mandatory references. Otherwise, select the is super user check box to allow the user to:
    • Ignore the mandatory references check for the entire batch without specifying a reason.
    • Enter a default loop number for all documents in the batch.

Helper functions

These functions set a default value for user input if the input element is not shown to the user:

Copy
Function GetConfirmation (Batch, Name, Default)
    GetConfirmation = Default
    On Error Resume Next
    GetConfirmation = Batch.Confirmation (Name).Value
    On Error Goto 0
End Function

Function GetComment (Batch, Name, Default)
    GetComment = Default
    On Error Resume Next
    GetComment = Batch.Confirmation (Name).Comment
    On Error Goto 0
End Function

Function GetInput (Batch, Name, Default)
    GetInput = Default
    On Error Resume Next
    GetInput = Batch.Input (Name).Value
    On Error Goto 0
End Function

Start the batch

Functionality implemented:

  • Set the dialog box title
  • Check if the user is a SuperUser. If so:
    • Open a dialog box to confirm whether missing references should be ignored for the entire batch.
    • Allow the user to enter a default loop number for the entire batch.
Copy
Sub DocCWFEvent_PreInitializeExecuteTransition(Batch, Transition, Person, Manager, Comment)
    Select Case Transition.Workflow.DisplayName & "." & Transition.DisplayName 
        Case "Test.Send for approval"
            Batch.ConfirmationTitle = Transition.DisplayName & " - Initialize batch" 
            If IsSuperUser Then
                Batch.AskConfirmation "Batch-SkipRefs", "Ignore missing references for entire batch?", AS_CDV_NO
                Batch.AskInput "Batch-LoopNr", "Enter default loop number:", AS_vbString, AS_VR_OPTIONAL 
            End If
    End Select
End Sub

Prepare to process a document (repeats for each document)

Functionality implemented:

  • Set the dialog title
  • Find missing references and store them in Batch.Argument for later use
  • If references are missing, show the list and ask the user whether they want to continue
  • Check whether the loop number is empty and if so, allow the user to enter it.
Copy
Sub DocCWFEvent_PreBeforeExecuteTransition(Batch, Transition, Person, Manager, Comment)
    Select Case Transition.Workflow.DisplayName & "." & Transition.DisplayName 
        Case "Test.Send for approval"
            Batch.ConfirmationTitle = Transition.DisplayName & " - " & Document.FileName
            sMissingRefs = MissingReferences
            Batch.Argument ("Doc-RefsMissing") = IsArray (sMissingRefs)
            If Batch.Argument ("Doc-RefsMissing") And GetConfirmation (Batch, "Batch-SkipRefs", AS_CDV_NO) = AS_CDV_NO Then
                Batch.ShowInfo Join (sMissingRefs, vbCrLf), "The following references are missing:"
                Batch.AskConfirmation "Doc-ContRefs", "Continue with this document?", AS_CDV_NO, AS_COMMENT_MANDATORY_YES
            End If
            
            If Document.LoopNr = "" And GetInput (Batch, "Batch-LoopNr", "")  = "" Then
                Batch.AskInput "Doc-LoopNr", "Please enter the loop number:", AS_vbString, AS_VR_OPTIONAL 
            End If
    End Select    
End Sub

The dialog box appears before the first wizard page.

Process a document (repeats for each document)

Functionality implemented:

  • BeforeExecuteTransition
    • Skip document if it has missing references and the user selected not to continue with it.
    • Add the name of the document to a Batch.Argument if the loop number is missing.
  • AfterExecuteTransition:
    • If documents are moved in workflow with missing mandatory references, this is logged.
Copy
Sub DocCWFEvent_BeforeExecuteTransition(Batch, Transition, Person, Manager, Comment)
    Select Case Transition.Workflow.DisplayName & "." & Transition.DisplayName 
        Case "Test.Send for approval"
            If GetConfirmation (Batch, "Doc-ContRefs", AS_CDV_NO) = AS_CDV_NO And GetConfirmation  (Batch, "Batch-SkipRefs", AS_CDV_NO) = AS_CDV_NO And Batch.Argument ("Doc-RefsMissing") Then
                Batch.FailCurrent "Skipped because of missing references"
            Else
                If Document.LoopNr = "" And GetInput (Batch, "Batch-LoopNr", "") = "" Then
                    If GetInput (Batch, "Doc-LoopNr", "") <> "" Then
                        Document.LoopNr = GetInput (Batch, "Doc-LoopNr", "")
                    ElseIf GetInput (Batch, "Batch-LoopNr", "") <> "" Then
                        Document.LoopNr = GetInput (Batch, "Batch-LoopNr", "")
                    Else
                        Batch.Argument ("MissingLoops") = Batch.Argument ("MissingLoops") & Document.FileName & vbCrLf
                    End If
                End If
            End If
    End Select
End Sub

Sub DocCWFEvent_AfterExecuteTransition(Batch, Transition, Person, Manager, Comment)
    Select Case Transition.Workflow.DisplayName & "." & Transition.DisplayName 
        Case "Test.Send for approval"
            If GetConfirmation (Batch, "Doc-ContRefs", AS_CDV_NO) = AS_CDV_YES And Batch.Argument ("Doc-RefsMissing") Then
                Document.Log "Sent for approval with missing references: " & GetComment (Batch, "Doc-ContRefs", "")
            End If
    End Select
End Sub

Finalize batch

Functionality implemented:

  • At the end of the batch, documents with missing loop numbers are listed.
Copy
Sub DocCWFEvent_TerminateExecuteTransition(Batch, Transition, Person, Manager, Comment)
    Select Case Transition.Workflow.DisplayName & "." & Transition.DisplayName 
        Case "Test.Send for approval"
            If Batch.Argument ("MissingLoops") <> "" Then
                Batch.ShowInfo Batch.Argument ("MissingLoops"), "Documents with missing loop numbers:"
            End If
    End Select
End Sub