Skip to main content
Newcomer
February 14, 2025

WorkflowEventHandler AfterEvent Action

  • February 14, 2025
  • 1 reply
  • 0 views

Hello,

I am currently working on the Business Rule WorkflowEventHandler to update a custom table when certain tasks are manually completed in a workflow. The scripts shown in the screenshot are located in the section where Case Is = BREventOperationType.Workflow.UpdateWorkflowStatus, with the following condition: If NOT args.IsBeforeEvent Then.

I want to trigger the function after the current workflow is fully completed. However, despite testing various syntax alternatives, the function consistently executes before the workflow is fully completed.

For example, when I initiate the last step of the current workflow, the function is always triggered at line 141. For context, this issue occurs when the workflows consist of multiple tasks. The final task varies depending on the workflow—it may end with Import, Confirm, or another task.
Below are the syntaxes I tested but without success.
Could you please help me resolve this issue?

Thanks

 

1 reply

Expert
February 17, 2025

This works for me on an item that has input forms:

Dim wfStatus As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, si.WorkflowClusterPk, True)
Dim wfTask As TaskInfo =  wfStatus.GetTask(New Guid(SharedConstants.WorkflowKeys.Tasks.InputForms))
If Not wfTask Is Nothing Then
	If wfTask.Status = WorkflowStatusTypes.Completed Then
.......

 

Newcomer
February 19, 2025

Many thanks, Marcus. I tested your code with a workflow that ends with the Import step. It only enters the Complete section when the task status is "InProcess." I have created a ticket to request OS support.