11 NOV, 2016:
The actual blog post has been updated to include all the necessary code for workflow development. Please read the actual post.
Let’s say we have students in the system. Some of the students are blocked due to overdue semester fees. System should be able to allow user to submit such students to a workflow process for approval to a super user e.g. Principal. Once the Principal approves such students only then students should be allowed to take more courses in the next semester.
1. Create a Workflow state Enum to have the following elements:
2. Add field of type Workflow state enum to the custom table FAZStudentTable. 3. Override canSubmitToWorkflow() method of the custom table to define Workflow submission criteria.
public boolean canSubmitToWorkflow(str _workflowType = '')
boolean ret = false;
if (this.Blocked == NoYes::Yes)
ret = true;
4. Create a Query for the custom table. 5. Create a Workflow Category. 6. Create a Workflow Type using wizard.
The following artifacts will be created:
7. Enable Workflow on the custom form FAZStudentTable by setting Design node properties as follows:
8. Give submit logic in SubmitManager class.
public static void main(Args _args)
submitManager = new FAZStudentTableSubmitManager();
public void submit(Args _args)
WorkflowComment note = "";
//Opens the submit to workflow dialog.
workflowSubmitDialog = WorkflowSubmitDialog::construct(
studentTable = _args.record();
// Get comments from the submit to workflow dialog.
note = workflowSubmitDialog.parmWorkflowComment();
studentTable.WorkflowStatus = MAKWorkflowStatus::Submitted;
// Send an Infolog message.
info("Submitted to workflow.");
error("Error on workflow activation.");
9. Create a Workflow Approval using the wizard.
10. Drag the newly created Approval to the Supported elements node of the custom Workflow Type. 11. Design the Workflow.
12. Test the workflow.
For your reference, see below the artifacts created in this development process: