Hello,

i'm using ez workflow component and wrote a variable handler to store
specific variables in a database table:

DROP TABLE IF EXISTS external_variable_store;
 CREATE TABLE external_variable_store (
 variable_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
 execution_id INTEGER UNSIGNED NOT NULL,
 variable_name VARCHAR(255) NOT NULL,
 variable_value TEXT NULL,
 PRIMARY KEY              (variable_id),
 UNIQUE  KEY idx_execution_variable (variable_id, execution_id),
INDEX par_ind (execution_id),
FOREIGN KEY (execution_id) REFERENCES execution(execution_id) ON DELETE CASCADE
 ) ENGINE=InnoDB;

DatabaseVariableHandler.php is here http://pastebin.com/m50d59f83 ,
still has nasty quick debug code.

I'm using the database execution method and i noticed that the
variable handlers are being called to save (saveToVariableHandlers())
the state after the end of the execution (within the end() method of
the execution) and this is breaking database foreign key referential
integrity because it will try to save a variable attached to an
execution ID that does not exist, since the execution has ended
already.

To overcome this, i'm currently checking if the $execution has ended
before saving the state in the "save( ezcWorkflowExecution $execution,
$variableName, $value )" method.

Also, when loading variables , i (will) delete the variable from the
persistence after loading.

I'm just asking if this is intended behaviour (saving execution
variable state after it's end).


--
José Moreira
* http://pt.linkedin.com/in/josemoreira
-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to