public function setWorkflowMode($mode = c\T::NONE, WorkflowDefinition $wd = NULL) { if (!c\WorkflowModeValues::isWorkflowMode($mode)) { throw new e\UnacceptableWorkflowModeException(S_SPAN . "The workflow mode {$mode} is unacceptable." . E_SPAN); } if ($mode == self::WORKFLOW_MODE_FACTORY) { if ($wd == NULL) { throw new e\NullAssetException(S_SPAN . c\M::NULL_WORKFLOW_DEFINITION . E_SPAN); } else { $this->getProperty()->workflowDefinitionId = $wd->getId(); $this->getProperty()->workflowDefinitionPath = $wd->getPath(); } } else { $this->getProperty()->workflowDefinitionId = NULL; $this->getProperty()->workflowDefinitionPath = NULL; } $this->getProperty()->workflowMode = $mode; return $this; }