def setUp(self): from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition self.site = DummySite('site') self.site._setObject('portal_types', DummyTool()) self.site._setObject('portal_workflow', WorkflowTool()) addWorkflowFactory(DCWorkflowDefinition) self._constructDummyWorkflow()
def setUp(self): from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition self.site = DummySite('site') self.site._setObject( 'portal_types', DummyTool() ) self.site._setObject( 'portal_workflow', WorkflowTool() ) addWorkflowFactory(DCWorkflowDefinition) self._constructDummyWorkflow()
def setupWorkflow(portal): portal_workflow = portal.portal_workflow addWorkflowFactory(createWorkflow, id=Sm_WORKFLOWID, title='ShortMessage Workflow') portal_workflow.manage_addWorkflow(id=Sm_WORKFLOWID, workflow_type=Sm_WORKFLOWID +' (ShortMessage Workflow)') addWorkflowScripts(portal_workflow[Sm_WORKFLOWID]) #set workflow for SMS portal_workflow.setChainForPortalTypes( ('ShortMessage'), Sm_WORKFLOWID)
def setUp(self): self.site = DummySite('site') self.site._setObject( 'portal_types', DummyTool() ) self.site._setObject( 'portal_workflow', WorkflowTool() ) addWorkflowFactory(DCWorkflowDefinition) # Construct a workflow wftool = self.site.portal_workflow wftool.manage_addWorkflow('Workflow (DC Workflow Definition)', 'wf') wftool.setDefaultChain('wf')
def setUp(self): self.site = DummySite('site') self.site._setObject('portal_types', DummyTool()) self.site._setObject('portal_workflow', WorkflowTool()) addWorkflowFactory(DCWorkflowDefinition) # Construct a workflow wftool = self.site.portal_workflow wftool.manage_addWorkflow('Workflow (DC Workflow Definition)', 'wf') wftool.setDefaultChain('wf')
def setUp(self): self.site = DummySite('site') self.site._setObject('portal_types', DummyTool()) self.site._setObject('portal_workflow', WorkflowTool()) self.site._setObject('portal_membership', MembershipTool()) self.site._setObject('acl_users', DummyUserFolder()) addWorkflowFactory(DefaultWorkflowDefinition, id='default_workflow', title='default_workflow') self._constructDummyWorkflow()
def setUp(self): self.site = DummySite('site') self.site._setObject('portal_types', DummyTool()) self.site._setObject('portal_workflow', WorkflowTool()) self.site._setObject('portal_membership', MembershipTool()) self.site._setObject('acl_users', DummyUserFolder()) addWorkflowFactory(DefaultWorkflowDefinition, id='default_workflow', title='default_workflow') self._constructDummyWorkflow()
def install_workflow(self, out): portal_workflow=getToolByName(self, 'portal_workflow') #register the workflow in the system addWorkflowFactory(createWorkflow, id=C_WORKFLOWID, title='Campaign Workflow') portal_workflow.manage_addWorkflow(id=C_WORKFLOWID, workflow_type=C_WORKFLOWID +' (Campaign Workflow)') #set workflow for Campaign portal_workflow.setChainForPortalTypes( (TYPE_NAME), C_WORKFLOWID) print >> out, "Installed workflow..."
def register(id, factory): """register workflow >>> from Products.AlphaFlow.Extensions import dcworkflow >>> def fac(): ... return dcworkflow.create('wf') >>> dcworkflow.register('wf', fac) """ def workflow_factory(workflow_id): if workflow_id != id: raise ValueError, "Id mismatch %r != %r" % (id, workflow_id) return factory() _registered_workflows.append(id) addWorkflowFactory(workflow_factory, id)
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createmeetingitem_archive_workflow(self, id): """Create the workflow for PloneMeeting. """ ob = DCWorkflowDefinition(id) setupmeetingitem_archive_workflow(self, ob) return ob addWorkflowFactory(createmeetingitem_archive_workflow, id='meetingitem_archive_workflow', title='meetingitem_archive_workflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
def install(): addWorkflowFactory(createPSC_release_workflow, id='psc_release_workflow', title='PSC Release workflow')
vdef = wf.variables['actor'] vdef.setProperties(description="""The ID of the user who performed the last transition""", default_value="""""", default_expr="""user/getId""", for_catalog=0, for_status=1, update_always=1, props=None) vdef = wf.variables['time'] vdef.setProperties(description="""Time of the last transition""", default_value="""""", default_expr="""state_change/getDateTime""", for_catalog=0, for_status=1, update_always=1, props=None) ## Worklists Initialization def createTrackback_workflow(id): "..." ob = DCWorkflowDefinition(id) setupTrackback_workflow(ob) return ob addWorkflowFactory(createTrackback_workflow, id='trackback_workflow', title='TrackBack Workflow')
default_expr="""transition/getId|nothing""", for_catalog=0, for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createWestminsterBillWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupWestminsterBillWorkflow(self, ob) return ob addWorkflowFactory(createWestminsterBillWorkflow, id='WestminsterBillWorkflow', title='WestminsterBillWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
def install (): addWorkflowFactory(createPSC_area_workflow, id='psc_area_workflow', title='PSC Area workflow')
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createWestminsterBillWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupWestminsterBillWorkflow(self, ob) return ob addWorkflowFactory(createWestminsterBillWorkflow, id='WestminsterBillWorkflow', title='WestminsterBillWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
# Worklist Initialization workflow.worklists.addWorklist('transcription_list') ldef = workflow.worklists['transcription_list'] ldef.setProperties(description='', actbox_name='', actbox_url='%(content_url)s', actbox_category='global', props={ 'var_match_assigned_to': '%(user_id)s', 'guard_roles': 'Reporter' }) ##/code-section create-workflow-setup-method-footer def createTakeWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupTakeWorkflow(self, ob) return ob addWorkflowFactory(createTakeWorkflow, id='TakeWorkflow', title='TakeWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
actbox_name="Pending (%(count)d)", actbox_url=actbox_url, actbox_category="global", props={'guard_permissions': 'Review portal content', 'guard_roles': '', 'var_match_review_state': ';'.join(worklistStates)}) # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createMemberApprovalWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupMemberApprovalWorkflow(self, ob) return ob addWorkflowFactory(createMemberApprovalWorkflow, id='MemberApprovalWorkflow', title='MemberApprovalWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createmeeting_workflow(self, id): """Create the workflow for PloneMeeting. """ ob = DCWorkflowDefinition(id) setupmeeting_workflow(self, ob) return ob addWorkflowFactory(createmeeting_workflow, id='meeting_workflow', title='meeting_workflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createMemberAutoWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupMemberAutoWorkflow(self, ob) return ob addWorkflowFactory(createMemberAutoWorkflow, id='MemberAutoWorkflow', title='MemberAutoWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
def setUp( self ): self.site = DummySite('site') self.site._setObject( 'portal_types', DummyTool() ) self.site._setObject( 'portal_workflow', WorkflowTool() ) addWorkflowFactory(DCWorkflowDefinition)
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createRotaItemWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupRotaItemWorkflow(self, ob) return ob addWorkflowFactory(createRotaItemWorkflow, id='RotaItemWorkflow', title='RotaItemWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
update_always=1, props=None) vdef = wf.variables['actor'] vdef.setProperties(description='The ID of the user who performed the ' 'last transition', default_value='', default_expr='user/getUserName', for_catalog=0, for_status=1, update_always=1, props=None) vdef = wf.variables['action'] vdef.setProperties(description='The last transition', default_value='', default_expr='transition/getId|nothing', for_catalog=0, for_status=1, update_always=1, props=None) def createWorkflow(id): """workflow creation""" ob = DCWorkflowDefinition(id) setupWorkflow(ob) return ob addWorkflowFactory(createWorkflow, id=ECMCR_WORKFLOW_ID, title=ECMCR_WORKFLOW_TITLE)
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createHansardWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupHansardWorkflow(self, ob) return ob addWorkflowFactory(createHansardWorkflow, id='HansardWorkflow', title='HansardWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
vdef = wf.variables['actor'] vdef.setProperties(description="""The ID of the user who performed the last transition""", default_value="""""", default_expr="""user/getId""", for_catalog=0, for_status=1, update_always=1, props=None) vdef = wf.variables['action'] vdef.setProperties(description="""The last transition""", default_value="""""", default_expr="""transition/getId|nothing""", for_catalog=0, for_status=1, update_always=1, props=None) ## Worklists Initialization def wfTest(): return 'ok' addWorkflowFactory(createSimpleblog_workflow, id='simpleblog_workflow', title='Workflow for Blog Entries')
actbox_name="Pending (%(count)d)", actbox_url=actbox_url, actbox_category="global", props={'guard_permissions': 'Review portal content', 'guard_roles': '', 'var_match_review_state': ';'.join(worklistStates)}) # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createBungeniWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupBungeniWorkflow(self, ob) return ob addWorkflowFactory(createBungeniWorkflow, id='BungeniWorkflow', title='BungeniWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
default_value="""""", default_expr="""transition/getId|nothing""", for_catalog=0, for_status=1, update_always=1, props=None, ) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createmeeting_archive_workflow(self, id): """Create the workflow for PloneMeeting. """ ob = DCWorkflowDefinition(id) setupmeeting_archive_workflow(self, ob) return ob addWorkflowFactory(createmeeting_archive_workflow, id="meeting_archive_workflow", title="meeting_archive_workflow") ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
props={'guard_permissions': 'Request review; Review portal content'}) vdef = wf.variables['time'] vdef.setProperties(description='Time of the last transition', default_value='', default_expr='state_change/getDateTime', for_catalog=0, for_status=1, update_always=1, props=None) # Worklist Initialization ldef = wf.worklists['program_list'] ldef.setProperties(description='List of programs', actbox_name='Count (%(count)d)', actbox_url='%(portal_url)s/search?review_state=pending', actbox_category='global', props={'guard_permissions': 'Review portal content', 'var_match_review_state': 'pending'}) def create_UWOshOIEProgramWorkflow(id): """Create, setup and return the workflow. """ ob = DCWorkflowDefinition(id) setup_UWOshOIEProgramWorkflow(ob) return ob addWorkflowFactory(create_UWOshOIEProgramWorkflow, id='UWOshOIEProgramWorkflow', title='UWOshOIE Program Workflow')
"""Retain security_related issues loss of confidentiality on completion""", default_value="""""", default_expr="""""", for_catalog=1, for_status=1, update_always=0, props=None) vdef = wf.variables['assigned_to'] vdef.setProperties(description="""Supporters assigned to the issue""", default_value="""""", default_expr="""""", for_catalog=1, for_status=1, update_always=0, props=None) ## Worklists Initialization def createCollector_issue_workflow(id): "..." ob = DCWorkflowDefinition(id) setupCollector_issue_workflow(ob) return ob addWorkflowFactory(createCollector_issue_workflow, id='collector_issue_workflow', title='Collector issue workflow')
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createOfficeWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupOfficeWorkflow(self, ob) return ob addWorkflowFactory(createOfficeWorkflow, id='OfficeWorkflow', title='OfficeWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
default_expr="""transition/getId|nothing""", for_catalog=0, for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createHansardWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupHansardWorkflow(self, ob) return ob addWorkflowFactory(createHansardWorkflow, id='HansardWorkflow', title='HansardWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
default_expr="""transition/getId|nothing""", for_catalog=0, for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createRotaItemWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupRotaItemWorkflow(self, ob) return ob addWorkflowFactory(createRotaItemWorkflow, id='RotaItemWorkflow', title='RotaItemWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
variableDef.setProperties(description="""The last transition""", default_value="""""", default_expr="""transition/getId|nothing""", for_catalog=0, for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createSubWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupSubWorkflow(self, ob) return ob addWorkflowFactory(createSubWorkflow, id='SubWorkflow', title='SubWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
default_expr="""transition/getId|nothing""", for_catalog=0, for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createRotaFolderWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupRotaFolderWorkflow(self, ob) return ob addWorkflowFactory(createRotaFolderWorkflow, id='RotaFolderWorkflow', title='RotaFolderWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
'the last transition', default_expr='user/getId', for_status=1, update_always=1) vdef = wf.variables['comments'] vdef.setProperties( description='Comments about the last transition', default_expr="python:state_change.kwargs.get('comment', '')", for_status=1, update_always=1) vdef = wf.variables['review_history'] vdef.setProperties(description='Provides access to workflow history', default_expr="state_change/getHistory", props={'guard_permissions': View}) vdef = wf.variables['time'] vdef.setProperties(description='Time of the last transition', default_expr="state_change/getDateTime", for_status=1, update_always=1) configureEventPermissions(wf) return wf addWorkflowFactory(createPatchWorkflow, id='patch_workflow', title='Patch Workflow [Rhaptos]')
for_status=1, update_always=1) vdef = wf.variables['actor'] vdef.setProperties(description='The ID of the user who performed ' 'the last transition', default_expr='user/getId', for_status=1, update_always=1) vdef = wf.variables['comments'] vdef.setProperties(description='Comments about the last transition', default_expr="python:state_change.kwargs.get('comment', '')", for_status=1, update_always=1) vdef = wf.variables['review_history'] vdef.setProperties(description='Provides access to workflow history', default_expr="state_change/getHistory", props={'guard_permissions': View}) vdef = wf.variables['time'] vdef.setProperties(description='Time of the last transition', default_expr="state_change/getDateTime", for_status=1, update_always=1) configureEventPermissions(wf) return wf addWorkflowFactory(createPatchWorkflow, id='patch_workflow', title='Patch Workflow [Rhaptos]')
update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createLensWorkflow(self, id): """Create the workflow for Lensmaker. """ ob = DCWorkflowDefinition(id) setupLensWorkflow(self, ob) return ob addWorkflowFactory(createLensWorkflow, id='LensWorkflow', title='Lens Workflow') ##code-section create-workflow-module-footer #fill in your manual code here addWorkflowFactory(createLensWorkflow, id='lens_workflow', title='Lens Workflow') ##/code-section create-workflow-module-footer
def install(): addWorkflowFactory(createPSC_area_workflow, id='psc_area_workflow', title='PSC Area workflow')
for_status=1) vdef = wf.variables['review_history'] vdef.setProperties(description='Provides access to workflow history', default_expr="getHistory()", props={'guard_permissions': p_request + ';' + p_review}) vdef = wf.variables['time'] vdef.setProperties(description='Time of the last transition', default_expr="_.DateTime()", for_status=1) ldef = wf.worklists['reviewer_queue'] ldef.setProperties(description='Reviewer tasks', actbox_name='Pending (%(count)d)', actbox_url='%(portal_url)s/search?review_state=pending', props={'var_match_review_state':'pending', 'guard_permissions':p_review}) def createDefaultWorkflow(id): ''' ''' ob = DCWorkflowDefinition(id) setupDefaultWorkflow(ob) return ob addWorkflowFactory(createDefaultWorkflow, id='default_workflow', title='Web-configurable workflow [default]')
def install (): addWorkflowFactory(createPSC_release_workflow, id='psc_release_workflow', title='PSC Release workflow')
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createParliamentWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupParliamentWorkflow(self, ob) return ob addWorkflowFactory(createParliamentWorkflow, id='ParliamentWorkflow', title='ParliamentWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createSubWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupSubWorkflow(self, ob) return ob addWorkflowFactory(createSubWorkflow, id='SubWorkflow', title='SubWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
default_expr="""transition/getId|nothing""", for_catalog=0, for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createOfficeWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupOfficeWorkflow(self, ob) return ob addWorkflowFactory(createOfficeWorkflow, id='OfficeWorkflow', title='OfficeWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
status[id] = value # Update state. status[self.state_var] = new_state tool = aq_parent(aq_inner(self)) tool.setStatusOf(self.id, ob, status) # Update role to permission assignments. self.updateRoleMappingsFor(ob) # Execute the "after" script. if tdef is not None and tdef.after_script_name: script = self.scripts[tdef.after_script_name] # Pass lots of info to the script in a single parameter. sci = StateChangeInfo( ob, self, status, tdef, old_sdef, new_sdef, kwargs) script(sci) # May throw an exception. # Return the new state object. if moved_exc is not None: # Propagate the notification that the object has moved. raise moved_exc else: return new_sdef Globals.InitializeClass(DCWorkflowDefinition) addWorkflowFactory(DCWorkflowDefinition, id='dc_workflow', title='Web-configurable workflow')
vdef = wf.variables['confidential'] vdef.setProperties(description="""Retain security_related issues loss of confidentiality on completion""", default_value="""""", default_expr="""""", for_catalog=1, for_status=1, update_always=0, props=None) vdef = wf.variables['assigned_to'] vdef.setProperties(description="""Supporters assigned to the issue""", default_value="""""", default_expr="""""", for_catalog=1, for_status=1, update_always=0, props=None) ## Worklists Initialization def createCollector_issue_workflow(id): "..." ob = DCWorkflowDefinition(id) setupCollector_issue_workflow(ob) return ob addWorkflowFactory(createCollector_issue_workflow, id='collector_issue_workflow', title='Collector issue workflow')
# Update state. status[self.state_var] = new_state tool = aq_parent(aq_inner(self)) tool.setStatusOf(self.id, ob, status) # Update role to permission assignments. self.updateRoleMappingsFor(ob) # Execute the "after" script. if tdef is not None and tdef.after_script_name: script = self.scripts[tdef.after_script_name] # Pass lots of info to the script in a single parameter. sci = StateChangeInfo(ob, self, status, tdef, old_sdef, new_sdef, kwargs) script(sci) # May throw an exception. # Return the new state object. if moved_exc is not None: # Propagate the notification that the object has moved. raise moved_exc else: return new_sdef InitializeClass(DCWorkflowDefinition) addWorkflowFactory(DCWorkflowDefinition, id='dc_workflow', title='Web-configurable workflow')
def setUp( self ): self.site = DummySite('site') self.site._setObject( 'portal_types', DummyTool() ) self.site._setObject( 'portal_workflow', WorkflowTool() ) addWorkflowFactory(DCWorkflowDefinition)
def setUp( self ): from Products.CMFCore.WorkflowTool import addWorkflowFactory addWorkflowFactory( DummyWorkflow )
def install (): addWorkflowFactory(createPSC_improvementproposal_workflow, id='psc_improvementproposal_workflow', title='PSC Improvement Proposal workflow')
'guard_permissions': 'Review portal content', 'guard_roles': '', 'var_match_review_state': ';'.join(worklistStates) }) # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createBungeniWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupBungeniWorkflow(self, ob) return ob addWorkflowFactory(createBungeniWorkflow, id='BungeniWorkflow', title='BungeniWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
def setUp( self ): from Products.CMFCore.WorkflowTool import addWorkflowFactory addWorkflowFactory( DummyWorkflow )
def install(): addWorkflowFactory(createPSC_package_workflow, id='psc_package_workflow', title='PSC Project workflow')
from Products.CMFCore.WorkflowTool import addWorkflowFactory from Products.CMFPlone.FolderWorkflow import createFolderWorkflow as baseCreateWorkflow from Products.CMFCore.permissions import View def setupBooleanWorkflow(wf): wf.transitions.deleteTransitions(['retract', 'show']) wf.states.deleteStates(['visible']) wf.states.setInitialState(id='private') # we might want to strip the unused transitions off the state, but I don't think it hurts anything # make sure Owner is represented, so we get owners in allowedRolesAndUsers wf.states.published.setPermission(View, 1, ('Anonymous', 'Manager', 'Owner')) def createBooleanWorkflow(id): wf = baseCreateWorkflow(id) setupBooleanWorkflow(wf) wf.setProperties(title='Boolean Workflow, DCWorkflow based') return wf addWorkflowFactory(createBooleanWorkflow, id='boolean_workflow', title='Boolean Workflow, DCWorkflow based')
def install (): addWorkflowFactory(createPSC_improvementproposal_workflow, id='psc_improvementproposal_workflow', title='PSC Improvement Proposal workflow')
for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createRotaFolderWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupRotaFolderWorkflow(self, ob) return ob addWorkflowFactory(createRotaFolderWorkflow, id='RotaFolderWorkflow', title='RotaFolderWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer
description="""Provides access to workflow history""", default_value="""""", default_expr="""state_change/getHistory""", for_catalog=0, for_status=0, update_always=0, props={'guard_permissions': 'Request review; Review portal content'}) ## Worklists Initialization ldef = wf.worklists['reviewer_queue'] ldef.setProperties( description="""Reviewer tasks""", actbox_name="""Pending (%(count)d)""", actbox_url="""%(portal_url)s/search?review_state=pending""", actbox_category="""global""", props={ 'guard_permissions': 'Review portal content', 'var_match_review_state': 'pending' }) def createEasyshop_order_workflow(id): "..." ob = DCWorkflowDefinition(id) setupEasyshop_order_workflow(ob) return ob addWorkflowFactory(createEasyshop_order_workflow, id='easyshop_order_workflow', title='EasyShop Order Workflow')
ldef = wf.worklists['reviewer_queue'] ldef.setProperties(description='Reviewer tasks', actbox_name='Pending (%(count)d)', actbox_url='%(portal_url)s/search?review_state=pending', props={'var_match_review_state':'pending', 'guard_permissions':p_review}) def createDefaultWorkflowRev2(id): ''' ''' ob = DCWorkflowDefinition(id) setupDefaultWorkflowRev2(ob) return ob addWorkflowFactory(createDefaultWorkflowRev2, id='default_workflow', title='Web-configurable workflow [Revision 2]') def setupDefaultWorkflowClassic(wf): ''' Sets up a DCWorkflow as close as possible to the old DefaultWorkflow, with only the private, pending, and published states. wf is a DCWorkflow instance. '''
default_expr="""transition/getId|nothing""", for_catalog=0, for_status=1, update_always=1, props=None) ## Worklists Initialization # WARNING: below protected section is deprecated. # Add a tagged value 'worklist' with the worklist name to your state(s) instead. ##code-section create-workflow-setup-method-footer #fill in your manual code here ##/code-section create-workflow-setup-method-footer def createMotionWorkflow(self, id): """Create the workflow for Bungeni. """ ob = DCWorkflowDefinition(id) setupMotionWorkflow(self, ob) return ob addWorkflowFactory(createMotionWorkflow, id='MotionWorkflow', title='MotionWorkflow') ##code-section create-workflow-module-footer #fill in your manual code here ##/code-section create-workflow-module-footer