Execution state persistence for workflow application

Serge Orlov sombDELETE at pobox.ru
Mon Nov 24 23:10:35 CET 2003


"Paolo Losi" <p.losi at netline.it> wrote in message news:mailman.1012.1069657901.702.python-list at python.org...
> Hi all,
> I'm pretty new to the python language so please excuse me
> if this is FAQ... I'm very glad to be part of the list! :-)
>
> I'm looking into a way to implement a generic workflow framework with python.
> The basic idea is to use python scripts as the way to specify workflow
> behavior. The framework should not only use scripts as a specification language
> but is going to leverage on python interpreter for the execution of the
> scripts.
> One of the possible solution is to have a one to one mapping
> between a interpreter process and a workflow instance.
>
> Since I want to be able to model also long running processes I need to
> cope with Execution state persistence. In other words..
> I'd like to stop the framework and restart it having all workflow
> instance processes resume exactly where they left.
>
> Ideally I would be nice to have dumpexec() e loadexec() builtin functions
> to dump and reload the state of the interpreter. I've not seen anything
> like that unfortunately...
>
> I've tried to look at exec statement but it doesn't seem to be good
> for execution persistence...
>
> Questions are:
>
> - does there exist a python framework for workflow that use
>    python script as a specification language and that
>    support "long running" workflows? I don't want to reinvent the wheel...
Not that I'm aware of.

>
> - does the implementation idea quickly depicted makes sense to you?
Partly. It's not complete and that makes it look more simple than
data persistence when it's not. The problem is that one day you will
have to upgrade your program and your last dumpexec won't be
compatible with your next loadexec(). You will have to separate
code from data to do it. So it means execution persistence is not
enough for real life use. Why not just use data persistence alone?

>
> - how do you suggest to implement execution persistence? Is there
>    any "standard" solution?
Use data persistence and your own custom loader. Don't be afraid
of the word loader. It's very simple. For a simple persistant "hello,
world!" program it's about 5-10 lines. I think ZoDB is the most
popular data persistence framework. It's very nice and simple.

-- Serge.








More information about the Python-list mailing list