Logo Search packages:      
Sourcecode: zope-cmfplacefulworkflow version File versions  Download package

def CMFPlacefulWorkflow::WorkflowPolicyConfig::WorkflowPolicyConfig::getPlacefulChainFor (   self,
  portal_type,
  start_here = False 
)
Get the chain for the given portal_type.

Returns None if no placeful chain is found.
Does _not_ acquire from parent configurations.

Usecases:
If the policy config is in the object that request the chain we cannot
take the 'below' policy.
In other case we test the 'below' policy first and, if there's no chain
found, the 'in' policy.

Definition at line 105 of file WorkflowPolicyConfig.py.

                                                                :
        """Get the chain for the given portal_type.

        Returns None if no placeful chain is found.
        Does _not_ acquire from parent configurations.

        Usecases:
        If the policy config is in the object that request the chain we cannot
        take the 'below' policy.
        In other case we test the 'below' policy first and, if there's no chain
        found, the 'in' policy.
        """
        workflow_tool = getToolByName(self, 'portal_placeful_workflow')

        chain = None
        policy = None
        if not start_here:
            policy = workflow_tool.getWorkflowPolicyById(self.getPolicyBelowId())
            # print "start here:", start_here, "type", portal_type, "policy", policy
            if policy != None:
                chain = policy.getChainFor(portal_type)

        policy = workflow_tool.getWorkflowPolicyById(self.getPolicyInId())
        # print "start here:", start_here, "type", portal_type, "policy", policy

        if chain == None and policy != None:
            chain = policy.getChainFor(portal_type)

        return chain

InitializeClass( WorkflowPolicyConfig )

Generated by  Doxygen 1.6.0   Back to index