Closed ferllings closed 8 years ago
More details, It works fine if I use the default naming convention: "app\models\swInternal" (My model is Internal)
But if I use "app\models\workflows\InternalWorkflow" I receive the error above.
How should I declare my workflow path in the behaviour ?
Hi @ferllings and sorry for the late reply (I'm on holiday right now :sunglasses:). To use a custom namespace for your workflows, the simplest solution is to initialise the reserved alias @workflowDefinitionNamespace as follows :
Yii::setAlias('@workflowDefinitionNamespace','app\\models\\workflows');
Another option is to declare explicitly the WorkflowSource component to use and more important, the class loader component. You can find a detailed description in the Documentation.
ciao
Thanks,
I found another way, adding that in the main.conf
'workflowSource' => [
'class' => 'raoul2000\workflow\source\file\WorkflowFileSource',
'definitionLoader' => [
'class' => 'raoul2000\workflow\source\file\PhpArrayLoader',
'path' => '@common/models/workflows'
]
],
Thanks for your hard work, your components is great!!
Hello,
I was using your workflow plugin with Yii1, and now I'm trying to move on yii2.
I updated my model and Workflow description, but I'm receiving an error:
Call to undefined method app\models\workflows\InternalWorkflow::attach() in /app/vendor/yiisoft/yii2/base/Component.php at line 672
Any idea?