Hi Simon,
Am Dienstag, 26. August 2008 06:32:10 schrieb Simon Baird:
> Does a workflow just disappear once it's finished running?
Yes. The execution is deleted from the workflow tables (if you use an
interactive workflow that needs to suspend and resume).
> If not, is there
> a way to fetch the variables from a workflow after it's finished?
In general you do something like this (sorry if some of the method names are
wrong - I do not remember them 100%):
$execution->start() or $execution->resume()
Then you can check if the workflow has stopped:
$execution->hasEnded()
After that you can fetch the execution variables:
$variables = $execution->getVariables()
Then you can save the variables you need to store somewhere else.
Another idea: before the end node, you could call an action node that stores
what's needed.
> Or should I be keeping track of the data I need somewhere outside the
> workflow?
I think, it depends on the workflow. E.g. if you want to implement the life
cycle of some object, you'd need to store the object when the workflow
reaches the state "published". If you want to create an object via a
workflow, I'd save the data before finishing via some workflow action.
I do not know your use case. But I'd prefer not to implement that much
business logic outside the workflow. Then it's easier to integrate the
workflow in different places of your application.
In general: I'd try to not double some data. If you do not need the execution
variables outside the workflow as long it is not finished, don't keep track
of them. As shown above, you can access them via the execution object.
Have a nice day
Thomas
--
Thomas Nunninger
Steinhalde 108
79117 Freiburg
Tel.: 0761-595 57 04
http://nunninger.info
USt-IdNr: DE259832548
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components