Creating a new trigger. Need help

Creating a new trigger. Need help

Wednesday 25 August 2004 2:25:57 am - 3 replies

Author Message

Eirik Alfstad Johansen

Wednesday 25 August 2004 3:42:20 am

Hi Luis,

Personally, I've done this the manual way, by starting the worflow with some code like this:

$db =& eZDB::instance();
		
		// fetch most recently modified content object
		$query =<<<EOF
SELECT
	id, 
	contentclass_id,
	current_version
FROM
	ezcontentobject
WHERE
	status = 1
ORDER BY
	modified DESC
LIMIT
	0,1
EOF;

		// for each returned row
		foreach($db->arrayQuery($query) as $temp)
		{
			// store in result in $object
			$object = $temp;
		}
		
		$contentClassID = $object['contentclass_id'];

Hope this helps!

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Paul Forsyth

Wednesday 25 August 2004 4:29:31 am

You only need to create a new workflow event for this. Use content/publish/after as the trigger and within the event you can decide whether the object is of the right class and do the right thing.

Have a look at creating a workflow event in the docs and come back to this thread if you have problems.

paul

luis muñoz

Wednesday 25 August 2004 4:54:55 am

I created an event multiplexer workflow which first send an email to the user who published the object and after that begins an approval workflow. The problem is that I don&#8217;t want that this workflow executes with forum items. How can I filter the class in both mailer and approval workflows? Or how can I filter in event multiplexer workflow?
I&#8217;m sure that object class is in the parameters that the workflow get but I don&#8217;t know how to get it.

Thanks in advance
Luis

You must be logged in to post messages in this topic!

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