Table of contents:
In the kernel, workflow event types are located in kernel/classes/workflowtypes. In extensions, custom workflow events are located in the eventtypes directory.
How to add your own workflow event type(s) in an extension?
(the bold text represents the variable parts of the names, you should alter them for your extension)
Your own event type class needs to extend eZWorkflowEventType. After your class definition, you also need to register it in the system.
include_once( 'kernel/classes/ezworkflowtype.php' ); class MyEventType extends eZWorkflowEventType { const WORKFLOW_TYPE_STRING = "myevent"; public function __construct() { // Set descriptive name $this->eZWorkflowEventType( MyEventType::WORKFLOW_TYPE_STRING, 'My event' ); } function execute( $process, $event ) { // Do stuff... return eZWorkflowType::STATUS_ACCEPTED; } } eZWorkflowEventType::registerEventType( MyEventType::WORKFLOW_TYPE_STRING, 'MyEventType' );
If eZ Publish doesn't seem to want to load your workflow event type, then you might want to check out some useful tips to get it to work at the Troubleshooting extensions page.
Article provided by eZpedia
All text is available under the terms of the GNU Free Documentation License
Powered by eZ Publish Community Project 4.2011
Hosted by Swiss eZ Publish partner YMC