Views:
Scenario:
An admissions officer needs to receive four required documents from each student. How can we create a workflow to detect required documents within a process?

Solution: 
Creating a workflow process to detect required documents missing from a file cabinet is indeed possible. Please refer to the following example of how this could be done. 
 
In this example, the students in this system will have four required documents to be accounted for, which are Student Schedule, Grades/Transcripts, Birth Certificate, and Advising Records.
Note: This workflow logic is an example of how this process can be set up. The steps can be altered to better fit your system.

1. When creating this workflow, the following trigger conditions were used. Utilizing this trigger condition will allow us to store a data record in the Student Files file cabinet, update the Status field to trigger to run the workflow manually. Then the Missing Docs keyword field will contain the results.

Start new workflow = if index entries of the document were changed
Status = is empty


2. Once the trigger conditions have been set, creating the following global variables will be necessary for this workflow.

Text type Global variables
  • Contains
  • StudentName
  • StudentNames

Integer type Global variables

  • Count
  • Counter
  • DocID

Keyword type Global variables

  • DocTypes
  • StudentList

Our example also has a File Cabinet named Student Files, which contains the following fields.

Text type

  • Document Type
  • Student
  • Status

Keyword type

  • Missing Docs

3. After the variables have been added, create an Assign Data step, which we named "Assign Variables" with the following assignments.

Workflow global variable = DocID = Index entry of the document = Doc ID
Workflow global variable = StudentList = File cabinet = DW_DWDOCID < > GV_DocID
Workflow global variable = Counter = Fixed entry = 0





4. Next, create another Assign Data step named "Get DocType Count," which will obtain our list of Students to check on and the total count of document types stored in the file cabinet.
This step contains the following assignments.

Workflow global variable = StudentName = Arithmetic expression = GV_StudentList[GV_Counter]
Workflow global variable = DocTypes = File cabinet = DW_StudentName = GV_StudentName
Workflow global variable = Count = Arithmetic expression = COUNT(GV_DocTypes)
Workflow global variable = Contains = Workflow global variable = DocTypes








5. Our next step will be a Condition, where we'll check whether all documents are accounted for for a given student. If all documents are found, we'll proceed to the next student.
In our example, since 4 document types are expected, we compare our Count to 4. Change this accordingly to your system. Otherwise, we'll break into a workflow section to check against each document type to determine which is missing for the student.

Condition: GV_Count = 4
Condition fulfilled: Then
Condition not fulfilled: Else


6. 
Next, we will check if the Birth Certificate document type is in our retrieved list of document types for this student. If found, we move to the next document type; otherwise, we add the document type to the index field "Missing Docs" and proceed to an Assign Data step. After executing the workflow, you can check this field for all missing documents in the data record.

The following information displays how these two steps are set up for each document type. 

Condition: GV_Contains like "%Birth Certificate%"
Condition fulfilled: Then
Condition not fulfilled: Else


Index data of the document = Missing Docs = Arithmetic expression = "" + GV_StudentName + " - " + "Birth Certificate" + ""




7. This setup is repeated for the remaining doc types. Once all document types have been checked, anything found to have been missing will be added to our Missing Docs keyword field, then exit to the Condition step named "End the loop or not."
This Condition will check if there are students who need to be processed still or not. 
 
Condition: GV_Counter + 1 < COUNT(GV_StudentList)
Condition fulfilled: Then
Condition not fulfilled: Else


8. If none are remaining, then we'll exit the workflow. Otherwise, we'll move onto an Assign Data step where we'll add one to our counter variable, then repeat the workflow, checking for missing documents for the next student.
 
Workflow global variable = StudentName = Arithmetic expression = GV_Counter + 1
Workflow global variable = DocTypes = Fixed entry = NULL 




Notice that we also clear the DocTypes global variable since we'll need a clean slate for processing the following user.

Once this workflow is saved and published, the workflow will proceed as the following; 

  1. Store a data record in the Student Files file cabinet. (Only needed to be done once)
  2. Once stored, open the data record, enter "Trigger" into the Status field to manually trigger the workflow, and close the data record.
  3. After a few moments, when you open the data record, the Missing Docs field will contain a list of Students and which documents they are missing.

If you ever need to rerun this process in the future, be sure to clear out all entries from the Missing Docs and Status field, then repeat steps 2 & 3.

KBA is applicable for both Cloud and On-premise Organizations.