Forums / Setup & design / Where am i wrong? pls Guide me ...

Where am i wrong? pls Guide me ...

Author Message

SathishKumar Subramanian

Monday 19 July 2004 10:05:49 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

Alex Jones

Tuesday 20 July 2004 9:29:48 am

Sathizh, this thread appears to be a duplicate of one you started in the Developer forum (http://ez.no/community/forum/developer/inside_workflow). While I understand the need to get your question answered, double-posting is not a good idea as it clutters up the forums, and is unlikely to get you an answer any quicker. In this case, the Developer forum appears to be the better choice, so I would ask that you please keep your updates in that thread.

I wish I could provide an answer to your post, but I don't have any experience with the Workflow system.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

eZ debug

Timing: Jan 18 2025 16:10:37
Script start
Timing: Jan 18 2025 16:10:37
Module start 'content'
Timing: Jan 18 2025 16:10:37
Module end 'content'
Timing: Jan 18 2025 16:10:38
Script end

Main resources:

Total runtime0.2630 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 587.7109180.8359
Module start 'content' 0.00720.0046 768.546993.8828
Module end 'content' 0.01190.2511 862.4297529.3281
Script end 0.2629  1,391.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00311.1976200.0002
Check MTime0.00130.4937200.0001
Mysql Total
Database connection0.00080.287110.0008
Mysqli_queries0.220983.99511410.0016
Looping result0.00150.57171390.0000
Template Total0.250895.410.2508
Template load0.00070.267710.0007
Template processing0.250195.086210.2501
Override
Cache load0.00050.195510.0005
Sytem overhead
Fetch class attribute can translate value0.00090.338110.0009
XML
Image XML parsing0.00030.115210.0003
General
dbfile0.00271.0205200.0001
String conversion0.00000.001930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs