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

def CMFPlacefulWorkflow::DefaultWorkflowPolicy::DefaultWorkflowPolicyDefinition::getChainFor (   self,
  ob,
  managescreen = False 
)
Returns the chain that applies to the object.

If chain doesn't exist we return None to get a fallback from portal_workflow.
We never return emtpy tuple that is good value for a chain.

Definition at line 194 of file DefaultWorkflowPolicy.py.

                                                 :
        """Returns the chain that applies to the object.

        If chain doesn't exist we return None to get a fallback from portal_workflow.
        We never return emtpy tuple that is good value for a chain.
        """

        cbt = self._chains_by_type
        if type(ob) == type(''):
            pt = ob
        elif hasattr(aq_base(ob), '_getPortalTypeName'):
            pt = ob._getPortalTypeName()
        else:
            pt = None

        if pt is None:
            return None

        chain = None
        if cbt is not None:
            chain = cbt.get(pt, MARKER)

        if chain is MARKER or chain is None:
            return None
        elif len(chain) == 1 and chain[0] == DEFAULT_CHAIN:
            default = self.getDefaultChain(ob)
            if default:
                if managescreen:
                    return chain[0]
                else:
                    return default
            else:
                return None

        return chain


Generated by  Doxygen 1.6.0   Back to index