Path

ez.no / exponential / documentation / development / extensions / workflow events / creating a new event


Creating a new event

Creating a new event

Step 1: Build the file structure for your new event

Events are grouped in different types of events. The most used group is Event.
The basic structure is that if you added an event x, it should be stored like this: extension/myextension/eventtypes/event/ezx/ezxtype.php.

Step 2: Inherit from eZWorkflowEventType

All events should include the file ./kernel/classes/ezworkflowtype.php and inherit from eZWorkflowEventType. The event must implement the function execute.

Step 3: Add associated template for the content class

If you have settings that should be set on the event you should create a template that is shown when you edit the workflow. The filename for an event x placed inside the Event group is extension/myextension/design/standard/templates/workflow/eventtype/edit/event_ezx.tpl.

Step 4: Add associated template for the content object

Some templates return the status EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE or EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE_REPEAT and needs a template. The location of this template is defined in the event.

Step 5: Add the new event to the configuration

Our new event must be configured in the appropriate configuration file.

extension/myextension/settings/workflow.ini.append:

[EventSettings]

ExtensionDirectories[]=myextension

AvailableEventTypes[]=event_ezx

Comments

A third line on the workflow.append to add

If you get the same error than I did:
Error: eZWorkflowType::loadAndRegisterType
Workflow type not found: event_yourevent

Then this line is going to make your day:

[EventSettings]
RepositoryDirectories[]=extension/myextension/eventtypes

If this isn't working for you...

Check there are no spaces between the variable names and assignments in the workflow.ini.append file - I've just lost two hours due to that. There's a typo in the exponential book that implies that spaces are ok. They are not!

Log in or create a user account to comment.

Contents

Development

Extensions
    Translation
    Introduction to extensions
    Building an Exponential module
    Design extension
    Datatypes
    Workflow events
       Introduction to events
       Unpublish
       Wrapping event
       Creating a new event
    Module
    Template operator
    Template function
Exponential datamodel
Exponential tuning and stability
Importing attribute data
Kernel
Libraries
Scripting
Standards
System overview
Test Suite
Using Doxygen to create API documenta...


Created

10/07/2003
10:18:11 am
by Jo Henrik Endrerud

Last updated

10/07/2003
10:18:38 am
by Jo Henrik Endrerud

Authors

Jo Henrik Endrerud



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.