[Product-Developers] collective.wtf and transition script

Serge Renfer serge.renfer at gmail.com
Fri Mar 30 09:32:09 UTC 2012


Hello,

I'm using collective.wtf to develop workflow of my product (ageliaco.rd2,
specific projects management) and I cannot get a "Before script" to execute
in a transition.

This is the first time I try this, I might do something wrong, I have:


   - ageliaco.rd2.Extensions.transitionscripts.py<http://ageliaco.rd2.extensions.transitionscripts.py/>
as
   module, with a function => def activateCycle(self, state_change):
   - rd2.cycle-workflow.csv  (content below) is the specific workflow
   associated with the typeageliaco.rd2.cycle type within workflow.xml
   (content below)


and I get this error :
Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module <wrapper>, line 5, in wrapper
  Module kss.core.actionwrapper, line 236, in apply
  Module plone.app.kss.content_replacer, line 264, in changeWorkflowState
  Module Products.CMFFormController.FSControllerPythonScript, line 105, in
__call__
  Module Products.CMFFormController.Script, line 145, in __call__
  Module Products.CMFCore.FSPythonScript, line 130, in __call__
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 344, in _exec
  Module script, line 42, in content_status_modify
   - <FSControllerPythonScript at
/rd/depot-de-projet/2012-1/content_status_modify>
   - Line 42
  Module Products.CMFCore.WorkflowTool, line 244, in doActionFor
  Module Products.CMFCore.WorkflowTool, line 555, in _invokeWithNotification
  Module Products.DCWorkflow.DCWorkflow, line 282, in doActionFor
  Module Products.DCWorkflow.DCWorkflow, line 421, in _changeStateOf
  Module Products.DCWorkflow.DCWorkflow, line 469, in _executeTransition
  Module OFS.ObjectManager, line 773, in __getitem__
KeyError: 'ageliaco.rd2.Extentions.transitionscripts.activateCycle'

Am I missing something (a ZCML subscribe ???) ?
Thanks for any clue ...

serge


workflow.xml :
<?xml version="1.0"?>
<object name="portal-workflow">
    <bindings>
        <type type_id="ageliaco.rd2.projets">
            <bound-workflow workflow_id="rd2.projets-workflow"/>
        </type>
        <type type_id="ageliaco.rd2.project">
            <bound-workflow workflow_id="rd2.projet-workflow"/>
        </type>
        <type type_id="ageliaco.rd2.cycle">
            <bound-workflow workflow_id="rd2.cycle-workflow"/>
        </type>
        <type type_id="ageliaco.rd2.bilan">
            <bound-workflow workflow_id="rd2.bilan-workflow"/>
        </type>
        <type type_id="ageliaco.rd2.note">
            <bound-workflow workflow_id="rd2.note-workflow"/>
        </type>
        <type type_id="ageliaco.rd2.auteur">
            <bound-workflow workflow_id="rd2.auteur-workflow"/>
        </type>
    </bindings>
</object>

rd2.cycle-workflow.csv :

[Workflow]
Id:,rd2.cycle-workflow
Title:,Cycle workflow
Description:,Workflow pour les cycles d administration de projets de R et D
Initial state:,draft
Type:,Workflow
State variable:,review_state

[State]
Id:,active
Title:,En cours
Description:,Le cycle est actif
Transitions,finish
Permissions,Acquire,Anonymous,Manager,Owner,Reader,Editor,Contributor,Authenticated,Reviewer
Access contents information,N,N,Y,Y,N,Y,Y,Y,Y
View,N,N,Y,Y,N,Y,Y,Y,Y
Modify portal content,N,N,Y,Y,N,Y,Y,N,Y
ageliaco.rd2 : Add Bilan,N,N,Y,Y,N,Y,Y,N,N
ageliaco.rd2 : Add Note,N,N,Y,N,N,N,N,N,Y

[State]
Id:,archived
Title:,Archive
Description:,Le cycle est une archive
Transitions,
Permissions,Acquire,Anonymous,Manager,Owner,Reader,Editor,Contributor,Authenticated,Reviewer
Access contents information,N,N,Y,Y,N,Y,Y,Y,Y
View,N,N,Y,Y,N,Y,Y,Y,Y
Modify portal content,N,N,Y,N,N,N,N,N,N
ageliaco.rd2 : Add Bilan,N,N,Y,N,N,N,N,N,N
ageliaco.rd2 : Add Note,N,N,Y,N,N,N,N,N,N

[State]
Id:,draft
Title:,Brouillon
Description:,Le cycle est en cours d elaboration
Transitions,activate
Permissions,Acquire,Anonymous,Manager,Owner,Reader,Editor,Contributor,Authenticated,Reviewer
Access contents information,N,N,Y,Y,N,Y,Y,N,Y
View,N,N,Y,Y,N,Y,Y,N,Y
Modify portal content,N,N,Y,Y,N,Y,Y,N,Y
ageliaco.rd2 : Add Bilan,N,N,Y,N,N,N,N,N,N
ageliaco.rd2 : Add Note,N,N,Y,N,N,N,N,N,N

[State]
Id:,over
Title:,Fini
Description:,Le cycle est fini
Transitions,"archiver, activate"
Permissions,Acquire,Anonymous,Manager,Owner,Reader,Editor,Contributor,Authenticated,Reviewer
Access contents information,N,N,Y,Y,N,Y,Y,Y,Y
View,N,N,Y,Y,N,Y,Y,Y,Y
Modify portal content,N,N,Y,N,N,N,N,N,N
ageliaco.rd2 : Add Bilan,N,N,Y,N,N,N,N,N,N
ageliaco.rd2 : Add Note,N,N,Y,N,N,N,N,N,N

[Transition]
Id:,activate
Title:,Activer le cycle
Description:,Activer le cycle
Target state:,active
Trigger:,User
Guard permission:,Review portal content
Script after:,ageliaco.rd2.Extentions.transitionscripts.activateCycle

[Transition]
Id:,archiver
Title:,Archiver le cycle
Description:,Archiver le cycle
Target state:,archived
Trigger:,User
Guard permission:,Review portal content
Script after:,ageliaco.rd2.Extentions.transitionscripts.archiveCycle

[Transition]
Id:,finish
Title:,Fermer le cycle
Description:,Fermer le cycle
Target state:,over
Trigger:,User
Guard permission:,Review portal content

[Transition]
Id:,reject
Title:,Rejeter
Description:,Rejet du cycle du projet
Target state:,draft
Trigger:,User
Guard permission:,Review portal content
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20120330/c8ac83be/attachment.html>


More information about the Product-Developers mailing list