raoul2000\workflow\source\file\GraphmlLoader::createWorkflowDefinition PHP Method

createWorkflowDefinition() private method

Merges all arrays extracted from the graphml file (workflow, nodes, edges) to create and return a single array descrbing a workflow.
private createWorkflowDefinition ( [] $w, [] $n, [] $e )
$w []
$n []
$e []
    private function createWorkflowDefinition($w, $n, $e)
    {
        $nodes = [];
        foreach ($n as $key => $node) {
            $newNode = [];
            if (isset($node['label'])) {
                $newNode['label'] = $node['label'];
            }
            $newNode['metadata'] = ['background-color' => $node['background-color'], 'color' => $node['color']];
            $newNode['transition'] = [];
            if (isset($e[$key])) {
                foreach ($e[$key] as $trgKey => $edge) {
                    $newNode['transition'][] = $n[$trgKey]['id'];
                    // $edge;
                }
            }
            $nodes[$node['id']] = $newNode;
        }
        return ['initialStatusId' => $w['initial'], 'status' => $nodes];
    }