[Zope-CMF] Stuck with DCWorkflow....

Dmitry S. Makovey dmitry@athabascau.ca
Thu, 29 May 2003 11:45:35 -0600


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi, I'm stuck with DCWorkflow and looking for enlightenment ;)

I'm working with plone, but i suppose it shouldn't make much difference.

I'm trying to create a new state : archive. Scenario is as follows: whenever
item is get published it should be copied over to an archive. Items in
archive should have their own state "archive", and published item remains
published.
My steps:
1. copied over folder_workflow (I know I should've used plone_workflow but for
the sake of simplicity I'll stay with it for awhile) to dimon_workflow
2. in dimon workflow:
 created new state: archive (no possible transition from that state)
 in dimon_workflow created script:
 <archiveOnPublish.py>
  o=getattr(state_change, 'object')
  obj_parent=o.aq_parent
  portal_root=context.portal_url.getPortalObject()
  wf_tool=portal_root.portal_workflow

  dest_name=getattr(portal_root,'archive')
  archive=getattr(portal_root,dest_name)
  ac=archive.manage_pasteObjects( obj_parent.manage_copyObjects(o.getId()) )

  workflow_action='copy_to_archive'
  comment='Auto-archived'
  for o in ac:
      a=getattr(archive,o['new_id'])
      wf_tool.doActionFor( a, workflow_action)
 </archiveOnPublish.py>
 created new transition copy_to_archive (Destination: archive, initiated by
workflow method)
 modified "publish" transition to run archiveOnPublish after transition
 modified "published" state to allow copy_to_archive transition
 changed private state to allow transition to archive state (copy_t
 Associated dimon_workflow with Course type
Now whenever I'm trying to "publish" Course I get:

<Error message>
Error Type
WorkflowException

Error Value
No workflow provides the "copy_to_archive" action.
</Error message>

Traceback doesn't tell much:
<Traceback>
Traceback (innermost last):
  Module ZPublisher.Publish, line 98, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module Products.CMFPlone.FormTool, line 235, in __call__
  Module Products.CMFPlone.NavigationTool, line 98, in getNextObject
  Module Products.CMFPlone.NavigationTool, line 289, in _getScript
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module Products.CMFCore.FSPythonScript, line 90, in __call__
  Module Shared.DC.Scripts.Bindings, line 252, in __call__
  Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
  Module Products.CMFCore.FSPythonScript, line 124, in _exec
   - __traceback_info__: ({'script': <FSPythonScript at
/arch/content_status_modify used for /arch/MAT244>, 'context': <Course
instance at 98d5680>, 'container': <PloneSite instance at 92f5740>,
'traverse_subpath': []}, ('publish', '', '', ''), {}, ('', None, None))
  Module Script (Python), line 8, in content_status_modify
  Module Products.CMFPlone.WorkflowTool, line 21, in doActionFor
  Module Products.CMFCore.WorkflowTool, line 309, in doActionFor
  Module Products.CMFCore.WorkflowTool, line 624, in _invokeWithNotification
  Module Products.DCWorkflow.DCWorkflow, line 275, in doActionFor
  Module Products.DCWorkflow.DCWorkflow, line 440, in _changeStateOf
  Module Products.DCWorkflow.DCWorkflow, line 543, in _executeTransition
  Module Shared.DC.Scripts.Bindings, line 252, in __call__
  Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 315, in _exec
  Module Script (Python), line 14, in archiveOnPublish
   - <PythonScript at
/arch/portal_workflow/dimon_workflow/scripts/archiveOnPublish>
   - Line 14
  Module Products.CMFPlone.WorkflowTool, line 21, in doActionFor
  Module Products.CMFCore.WorkflowTool, line 302, in doActionFor
WorkflowException: No workflow provides the "copy_to_archive" action.
</Traceback>

Any ideas what I've done wrong?

- --
Dmitry Makovey
Web Systems Administrator
Athabasca University
(780) 675-6245

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQE+1kdAyDrVuGfS98QRAvo2AKCY+T7V4Ja1Rl/WSoKsE2+5A0uyzQCaAkEx
pKR42rTgkU/vdCd4Is4OMXE=
=PqYu
-----END PGP SIGNATURE-----