Approval Workflow

Author Message

Peter Putzer

Wednesday 15 June 2005 5:56:34 am

Hi!

I've got some trouble with approval workflows on our site (http://pluspunkt.at). I haven't got root access and no CLI PHP. I have so far edited the workflow scripts to allow them to be run via the normal web PHP.

My cronjobs are run from index.php since I don't know whether I would need to tell my ISP to set up the cronjobs. Since I doubt that they would work from the command line if there's no CLI PHP, I haven't done this yet.

Almost everything works fine, except that items (comments) that are /denied/ sometimes still show up as published. I haven't been able to determine the exact cause of this, but I guess it's some kind of race condition between the notification and workflow cronjob.

Does anyone in here know more about this phenomenon (and hopefully a workaround/fix)?

Greetings,

Peter

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

Xavier Dutoit

Wednesday 15 June 2005 6:47:49 am

Could you describe how you run the cronjobs from the index ? Don't get it...

X+

http://www.sydesy.com

Peter Putzer

Wednesday 15 June 2005 7:16:35 am

* Run Notification Filters */
$notifyFilterLastRunTimeFile = 'ezfilternotify_last_runtime';
$filterAutoRunInterval = 60; //every minute
$runFilter = false;
if( file_exists($notifyFilterLastRunTimeFile) )
{
  if( time() - filemtime( $notifyFilterLastRunTimeFile ) > $filterAutoRunInterval )
  {
	$runFilter = true;
  }
}
else
  $runFilter = true;

if( $runFilter )
{
  /* Run notifications */
  include_once( 'kernel/classes/notification/eznotificationeventfilter.php' );
  touch($notifyFilterLastRunTimeFile);
  eZNotificationEventFilter::process();
}

/* Run Workflow cronjob */
$workflowLastRunTimeFile = 'ezworkflow_last_runtime';
//$workflowAutoRunInterval = 300; //every 5 minutes
$workflowAutoRunInterval = 50; //every 50 seconds
$runWorkflow = false;
if( file_exists($workflowLastRunTimeFile) )
{
  if( time() - filemtime( $workflowLastRunTimeFile ) > $workflowAutoRunInterval )
  {
	$runWorkflow = true;
  }
}
else
  $runWorkflow = true;

if( $runWorkflow )
{
  /* Run workflow */
  $isQuiet = true;
  touch($workflowLastRunTimeFile);
  include_once( 'cronjobs/workflow.php' );  
}

Accessible website starting from eZ publish 3.0 (currently: 4.1.0): http://pluspunkt.at

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