Inside workflow ....

Author Message

SathishKumar Subramanian

Monday 19 July 2004 10:07:36 am

HI ,

I am using ez version 3.2-4 . A workflow was created inside kernel\classes\workflowtypes\event\

While submitting an object (say it as <b>school</b>) in ezpublish admin interface, I am calling the workflow and that will check the object is 'school' or not. If it is a 'school' object then my requirement is to collect all 'school' object details from the <b>ezPublish database (ezDb)</b> and using 'mysql_select_db' I am connecting to another <b>database (reportDb) </b> and inserting/updating the object details in the 'reportDb' database.

Inside the workflow - php file, using a loop statement and <b>mysql_select_db(ezDb,$connect)</b> I am getting all the <b>ezDb - school object</b> details and inserting them inside the <b>reportDb</b> after the <b>mysql_select_db('reportDb',$connect) </b> statement.

<b>mycoding is like :</b>

if ( $object_class == '45') //school object class is 45
{
$connect=mysql_connect("server", "user", "password");
mysql_select_db('ezDb',$connect);
$sql="select school_object ...";
$rs = mysql_query($sql);
for($i=0; $i< ...) //for loop to get all school object details
{
//get all school object details

mysql_select_db('reportDb',$connect); //connect to reportDb database
//if bible school object not in tbSchool table then insert
$sql="insert into tbSchool ....";
//else update
$sql="update tbSchool set ...";

$rs = mysql_query($sql); //execute

}
}
//---------------------end -----------------

Here while trying to switch between the two databases, the workflow is not accepting the required flow. Its not calling the mysql_select_db database method.

So I have created a <b>separate file</b> like <b>'bibleSchool.php'</b> with the code like the above and tried to call the <b>'bibleSchool.php'</b> file inside the <b>workflow</b>.

so now the workflow code is like :

if ( $object_class == '45')//school object class is 45
{
//the 'bibleSchool.php' file resides in ez Publish root directory
include('bibleSchool.php');
}

But the Ez system is not running the bibleSchool.php file. So I am not getting the result in the reportDb database. All queries are running in database and passing data are correct. But while trying to run it inside workflow this code is not working.

Am I wrong in any place? How can I make it to run better.

Pls help. Thanx in advance.

Sathizh

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

eZ debug

Timing: Jan 19 2025 01:00:02
Script start
Timing: Jan 19 2025 01:00:02
Module start 'layout'
Timing: Jan 19 2025 01:00:02
Module start 'content'
Timing: Jan 19 2025 01:00:03
Module end 'content'
Timing: Jan 19 2025 01:00:03
Script end

Main resources:

Total runtime1.2577 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0119 589.0313152.6094
Module start 'layout' 0.01190.0117 741.640639.4141
Module start 'content' 0.02371.2324 781.0547416.3828
Module end 'content' 1.25610.0016 1,197.43758.1875
Script end 1.2577  1,205.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.3673160.0003
Check MTime0.00130.1073160.0001
Mysql Total
Database connection0.00210.167410.0021
Mysqli_queries1.136090.3250460.0247
Looping result0.00050.0434440.0000
Template Total1.126889.620.5634
Template load0.00240.192120.0012
Template processing1.124389.395520.5622
Template load and register function0.00030.021410.0003
states
state_id_array0.00120.098510.0012
state_identifier_array0.00080.063220.0004
Override
Cache load0.00200.1593380.0001
Sytem overhead
Fetch class attribute can translate value0.00070.058310.0007
Fetch class attribute name0.00120.095810.0012
XML
Image XML parsing0.00010.009910.0001
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.02942.3387100.0029
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs