gustafn
committed
10 months ago
Shared Workflow Definitions (Part 2)

When shared workflow definition are used, a different management of
object specific code is necessary,… Show more
Shared Workflow Definitions (Part 2)

When shared workflow definition are used, a different management of

object specific code is necessary, since one definition seves for many

objects, and it is not freshly created per object. Therefore, a new

concept is introduced for workflow definitions, named "object-specifc"

Instead of writing in a workflow definition

 Action save

 state initial -actions {save}

 [my object] proc foo {} { ns_log notice "===foo==="}

one has to write now:

 Action save

 state initial -actions {save}

 :object-specific {

   :proc foo {} { ns_log notice "===foo==="}

 }

where the object-specific is evaluated once per request for every

involved workflow instance in the context of the object (a [self]

in this block refers to the object).

In case a [my object] is encountered and sharedWorkflowDefinition is

activated, a warning is produced and the code falls back to old-style

shared workflow definitions.

Show less