From d4fb263bf5ba81c070b65d080e2c9f87db982238 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 8 Jun 2024 00:38:28 +0530 Subject: [PATCH] docs: onGoForward --- server/src/workflow-management/classes/Generator.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/src/workflow-management/classes/Generator.ts b/server/src/workflow-management/classes/Generator.ts index 4d91462f..2ae4737e 100644 --- a/server/src/workflow-management/classes/Generator.ts +++ b/server/src/workflow-management/classes/Generator.ts @@ -536,7 +536,14 @@ export class WorkflowGenerator { this.socket.emit('workflow', this.workflowRecord); } - + /** + * Generates a pair for navigating to the next page. + * This function alone adds the pair to the workflow and notifies the client. + * It's safe to always add a go forward action to the first rule in the workflow and do not check + * general conditions for adding a pair to the workflow. + * @param newUrl The next page's url. + * @returns void + */ public onGoForward = (newUrl: string) => { //it's safe to always add a go forward action to the first rule in the workflow this.workflowRecord.workflow[0].what.push({