• Arnaud Fontaine's avatar
    RFC: ERP5Workflow: Existing Workflow PythonScript should not require any change. · f5374810
    Arnaud Fontaine authored
    * Add WORKFLOW.{scripts,transitions...} property which is just a ComputedAttribute
      returning a dict (TODO: Instead of a dict, this should be ContainerTab to have
      objectIds()...).
    
    * Allow a Workflow Script to call another one by overriding portal_workflow.__getattr__.
      With DCWorkflow, `container` was bound to its parent (WORKFLOW.scripts which is a
      mapping), but now `container` is bound to the WORKFLOW itself as Transitions, Scripts
      and Variables are all at the same level. This is not very efficient but this is only
      in DCWorkflow compatibility mode after all.
    
      The initial implementation was creating a `ScriptContext`, a temporary object with
      all scripts of the current Workflow added. However, this required changing existing
      Workflow Script code and especially this did not work with the following use case:
      1. Script Context is created before calling a Workflow Script.
      2. That script calls a Workflow Script from another Workflow.
         => This will fail as ScriptContext is only created for the Workflow.
    
    This commit is going to be squashed before merging to master.
    f5374810
validateTransactionLines.py 546 Bytes