/**
* Check if the workflow is active
*
* @param string $context The context of the workflow
*
* @return boolean
*/
public function isWorkflowActive($context) : bool
{
$parts = explode('.', $context);
$config = ComponentHelper::getParams($parts[0]);
if (!$config->get('workflow_enabled')) {
return false;
}
$modelName = $this->getModelName($context);
if (empty($modelName)) {
return false;
}
$component = $this->getMVCFactory();
$appName = Factory::getApplication()->getName();
$model = $component->createModel($modelName, $appName, ['ignore_request' => true]);
return $model instanceof WorkflowModelInterface;
}