[erlang-questions] Workflow process model

Chris King colanderman@REDACTED
Tue Oct 29 22:33:57 CET 2013

On Tue, Oct 29, 2013 at 4:28 PM, Charles Irvine <chuck.irvine@REDACTED>wrote:

> I do realize that workflow state will need to be stored to a database.

Usually you want to choose between storing state in a process or in a
database.  The only time you'd want to do both is for caching (in which
case you would either have many short-lived processes or a few long-lived

> I don't envision much in the way of client sessions.

If you have clients connecting over TCP or something you definitely want
per-client processes (even if they only process one request and then end
the session).  Doing this will simplify your code flow dramatically.

> The thing that will drive the system are task completions. Task completion
> adds information to the workflow context and generates new tasks to be
> completed.

This is the biggest decision to make IMO with respect to process model.
 Depending on the complexity of this process, you could either:

1) perform a mnesia transaction in the client process
2) start a process to perform the mnesia transaction (and maybe other
3) call a long-lived process (a gen_server) to perform the mnesia
transaction (and maybe other actions that must be synchronized)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131029/e1aea09e/attachment.htm>

More information about the erlang-questions mailing list