GetExecutionResult
int
private function CBPWorkflow::GetExecutionResult();
This method returns a result for the completed workflow.
Returned value
Returned value corresponds to constants of the CBPActivityExecutionResult class. Possible values:
- CBPActivityExecutionResult::None - workflow completion result was not established,
- CBPActivityExecutionResult::Succeeded - workflow was completed successfully,
- CBPActivityExecutionResult::Canceled - workflow was cancelled,
- CBPActivityExecutionResult::Faulted - workflow stopped due to error,
- CBPActivityExecutionResult::Uninitialized - workflow was not initialized.
Examples
<?
$runtime = CBPRuntime::GetRuntime();
try
{
$workflow = $runtime->GetWorkflow($workflowId);
}
catch (Exception $e)
{
//
}
$executionResult = $workflow->GetExecutionResult();
switch ($executionResult)
{
case CBPActivityExecutionResult::None:
echo "No";
break;
case CBPActivityExecutionResult::Succeeded:
echo "Success";
break;
case CBPActivityExecutionResult::Canceled:
echo "Canceled";
break;
case CBPActivityExecutionResult::Faulted:
echo "Faulted";
break;
case CBPActivityExecutionResult::Uninitialized:
echo "Uninitialized";
break;
default:
echo "Uninitialized";
}
?>
© «Bitrix24», 2001-2024