Workflow event error

Author Message

Rhino Vincent

Thursday 13 September 2007 6:39:12 am

I did this worflow event just to learn but i get an error, and i dont know how to fix it so if somebody can help??

in the file ezexampletype.php :

<?php
define("EZ_WORKFLOW_TYPE_EXAMPLE_ID", "ezexample");
class eZExampleType extends eZWorkflowEventType
{
/*!
Constructor
*/
function eZExampleType()
{
$this->eZWorkflowEventType("EZ_WORKFLOW_TYPE_EXAMPLE_ID","Example");
$this->setTriggerTypes(array('content'=>array('read'=>array('before'))));
}

/*
On doit implémenter la fonction execute
*/
function execute( &$process, &$event )
{
$parameters =& $process->attribute('parameter_list');
$http =& eZHTTPTool::instance();
if($http->hasPostVariable('ContinueButton'))
{
return EZ_WORKFLOW_TYPE_STATUS_ACCEPTED;
}
$node=& eZContentObjectTreeNode::fetch($parameters['node_id']);
$requestUri = eZSys::requestUri();
$process->Template = array('templateName'=>'design:workflow/eventtype/result/event_ezexample.tpl','templateVars'=>array('node'=>$node,'request_uri'=>$resquestUri));
return EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE_REPEAT;
}
}
eZWorkflowEventType::registerType(EZ_WORKFLOW_TYPE_EXAMPLE_ID,'ezexampletype');
?>

in the workflow.ini.append.php :
<?php /*
[EventSettings]
ExtensionDirectories[]=myevent
AvailableEventTypes[]=event_ezexample
*/
?>

and i active the extension.

but when i try to create a new workflow by th admin interface i have this erreur
Error: eZWorkflowType::loadAndRegisterType Sep 13 2007 15:30:27

Workflow type not found: event_EZ_WORKFLOW_TYPE_EXAMPLE_ID, searched in these directories: kernel/classes/workflowtypes, extension/myevent/eventtypes

so if sommbody know why???

Olivier Ouin

Thursday 13 September 2007 8:03:03 am

Where did you put your ezexampletype.php file ?

I think it should be in
/extension/myevent/eventtypes/event/ezexample/
according to your workflow.ini

Could you check this ?

Atle Pedersen

Friday 14 September 2007 12:15:30 am

Hi!

This line:
$this->eZWorkflowEventType("EZ_WORKFLOW_TYPE_EXAMPLE_ID","Example");

should be like this:
$this->eZWorkflowEventType(EZ_WORKFLOW_TYPE_EXAMPLE_ID,"Example");

Atle

Rhino Vincent

Friday 14 September 2007 1:12:00 am

tks for the hepl i where write it was $this->eZWorkflowEventType("EZ_WORKFLOW_TYPE_EXAMPLE_ID","Example");

should be
$this->eZWorkflowEventType(EZ_WORKFLOW_TYPE_EXAMPLE_ID,"Example");

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.