raoul2000 / yii2-workflow

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

Error Exception: #14

Closed marcoadasilvaa closed 8 years ago

marcoadasilvaa commented 8 years ago

Hello, thanks for this contribution.

i'm trying implement a workflow with model Proveedor, but return Interface 'raoul2000\workflow\base\IWorkflowDefinitionProvider' not found

Model ProveedorWorkflow.php

<?php
namespace app\models;

class ProveedorWorkflow implements \raoul2000\workflow\base\IWorkflowDefinitionProvider 
{
    public function getDefinition() {
        return [
            'initialStatusId' => 'draft',
            'status' => [
                'draft' => [
                    'transition' => ['publish','deleted']
                ],
                'publish' => [
                    'transition' => ['draft','deleted']
                ],
                'deleted' => [
                    'transition' => ['draft']
                ]
            ]
        ];
    }
}

Model Proveedor

class Proveedor extends \yii\db\ActiveRecord
{

    public function behaviors()
    {
        return [
            \raoul2000\workflow\base\SimpleWorkflowBehavior::className()
        ];
    }
...
raoul2000 commented 8 years ago

Hi, in the latest release, the IWorkflowDefinitionProviderinterface belongs to the name space raoul2000\workflow\source\file.

Sorry for the error in the README.md file... I'll fix it soon.

marcoadasilvaa commented 8 years ago

Thank you for you asnwer, i create pull request #16 #15

raoul2000 commented 8 years ago

thanks for your contribution