raoul2000 / yii2-workflow

A simple workflow engine for Yii2
BSD 3-Clause "New" or "Revised" License
171 stars 48 forks source link

customize node shapes based on workflow #39

Closed mounicapav closed 7 years ago

mounicapav commented 7 years ago

how to add shape or symbol in meta data in a workflow definition?? like.... class ProjTaskWorkflow implements IWorkflowDefinitionProvider { public function getDefinition() {

return [ 'initialStatusId' => 'idle',

        'status' => [
            'idle' => [
                'label'      => 'Idle Stage',
                'transition' => ['design'],

                'metadata'   => [

                   'color' => 'yellow',
           'shape' => ['diamond'],

                ],
            ],
            'design' => [
                'transition' => ['idle','approve'],
                'metadata'   => [
                    'color' => 'grey',
       ]
            ],
            'approve' => [
                'transition' => ['idle','design','start'],
                'metadata'   => [
                    'color' => 'blue'
                ]
            ],
            'start' => [
                'transition' => ['idle','devcomplete'],
                'metadata'   => [
                    'color' => 'green'
                ]                   
            ],
            'devcomplete' => [
                'transition' => ['idle','start','review'],
                'metadata'   => [
                    'color' => 'pink'
                ]                       
            ],
            'review' => [
                'transition' => ['idle','start','testing'],
                'metadata'   => [
                    'color' => 'orange'
                ]                       
            ],

            'testing' => [
                'transition' => ['start','finished'],
                'metadata'   => [
                    'color' => 'blue'
                ]                       
            ],
    'finished' => [

                'metadata'   => [
                    'color' => 'violet'
                ]                       
            ]

        ]

    ];
}

}

mounicapav commented 7 years ago

i resolved it. thank you.