runBranchQueue - noetl/noetl GitHub Wiki

E.g. exitCode = runBranchQueue(taskInstance, branchQueue)

Parameters

  • task: task instance associated with the branches in the queue
  • branchQueue: contains all the branch instances to be forked

Key Variables

  • exitCode: records the success of the function
  • branch: current branch in the branchQueue

Functionality

  • RunBranchQueue first checks if the branchQueue is empty, and returns -1 if it is.
  • Otherwise, the exitCode is initialized to 0, and gets the next branch from the branchQueue. The exitCode is set to the return value of calling getStep on the current branch. When getStep returns, that branch is marked as done in the queue, and the exitCode is returned.

Except Statement

If an error arises, the except block writes to the log file, recording the time, the branchName, and the error message.

The exitCode is set equal to -1 and returned, indicating a failure.

Return Value

Returns the exitCode.