public function getImportedWorkflows($name = null)
    {
        $imports = DataObject::get(ImportedWorkflowTemplate::class);
        $importedDefs = array();
        foreach ($imports as $import) {
            if (!$import->Content) {
                continue;
            }
            $structure = unserialize($import->Content);
            $struct = $structure[Injector::class]['ExportedWorkflow'];
            $template = Injector::inst()->createWithArgs(WorkflowTemplate::class, $struct['constructor']);
            $template->setStructure($struct['properties']['structure']);
            if ($name) {
                if ($struct['constructor'][0] == trim($name)) {
                    return $template;
                }
                continue;
            }
            $importedDefs[] = $template;
        }
        return $importedDefs;
    }
public function getImportedWorkflows($name = null)
    {
        $imports = DataObject::get(ImportedWorkflowTemplate::class);
        $importedDefs = array();
        foreach ($imports as $import) {
            if (!$import->Content) {
                continue;
            }
            $structure = unserialize($import->Content);
            $struct = $structure[Injector::class]['ExportedWorkflow'];
            $template = Injector::inst()->createWithArgs(WorkflowTemplate::class, $struct['constructor']);
            $template->setStructure($struct['properties']['structure']);
            if ($name) {
                if ($struct['constructor'][0] == trim($name)) {
                    return $template;
                }
                continue;
            }
            $importedDefs[] = $template;
        }
        return $importedDefs;
    }
public function getImportedWorkflows ( $ name = null ) { $ imports = DataObject :: get ( ImportedWorkflowTemplate :: class ) ; $ importedDefs = array ( ) ; foreach ( $ imports as $ import ) { if ( ! $ import -> Content ) { continue ; } $ structure = unserialize ( $ import -> Content ) ; $ struct = $ structure [ Injector :: class ] [ 'ExportedWorkflow' ] ; $ template = Injector :: inst ( ) -> createWithArgs ( WorkflowTemplate :: class , $ struct [ 'constructor' ] ) ; $ template -> setStructure ( $ struct [ 'properties' ] [ 'structure' ] ) ; if ( $ name ) { if ( $ struct [ 'constructor' ] [ 0 ] == trim ( $ name ) ) { return $ template ; } continue ; } $ importedDefs [ ] = $ template ; } return $ importedDefs ; }
Generates an array of WorkflowTemplate Objects of all uploaded workflows.

@param string $name. If set, a single-value array comprising a WorkflowTemplate object who's first
constructor param matches $name is returned.
@return WorkflowTemplate|WorkflowTemplate[]
Generates an array of WorkflowTemplate Objects of all uploaded workflows .