Hi.
Here’s my scenario.
-
Just create a test table with two columns (id, status).
-
Setup the simpleWorkflow as you describe in the docs.
-
Within a command, just do:
<?php
class ProcessIncomingInvoiceInterfaceFileCommand extends CConsoleCommand {
public function run($args) {
$sw = new SwTest();
echo $sw->swGetStatus()->getLabel() . PHP_EOL;
if (!$sw->save())
print_r($sw->getErrors ());
yii::app()->end();
}
}
?>
Here’s the result:
Pending
Array
(
[status] => Array
(
[0] => value "" is not a valid status
)
)
Here’s the swSwTest.php
<?php
return array(
'initial' => 'pending',
'node' => array(
array('id' => 'pending', 'label' => yii::t('app', 'Pending'), 'transition' => 'processing'),
array('id' => 'processing', 'label' => yii::t('app', 'Processing')),
)
);
?>
Regards.