Пример #1
0
 def getWorkflowById(self, wf_id):
     """ Retrieve a given workflow.
     """
     wf = getattr(self, wf_id, None)
     if getattr(wf, '_isAWorkflow', False) or \
             IWorkflowDefinition.providedBy(wf):
         return wf
     else:
         return None
Пример #2
0
 def getWorkflowById(self, wf_id):
     """ Retrieve a given workflow.
     """
     wf = getattr(self, wf_id, None)
     if getattr(wf, '_isAWorkflow', False) or \
             IWorkflowDefinition.providedBy(wf):
         return wf
     else:
         return None
Пример #3
0
 def getWorkflowById(self, wf_id):
     """ Retrieve a given workflow.
     """
     wf = getattr(self, wf_id, None)
     if IWorkflowDefinition.providedBy(wf):
         return wf
     if getattr(wf, '_isAWorkflow', False):
         # BBB
         warn("The '_isAWorkflow' marker attribute for workflow "
              "definitions is deprecated and will be removed in "
              "CMF 2.3;  please mark the definition with "
              "'IWorkflowDefinition' instead.",
              DeprecationWarning, stacklevel=2)
         return wf
     else:
         return None
Пример #4
0
    def getWorkflowIds(self):

        """ Return the list of workflow ids.
        """
        wf_ids = []

        for obj_name, obj in self.objectItems():
            if IWorkflowDefinition.providedBy(obj):
                wf_ids.append(obj_name)
            elif getattr(obj, '_isAWorkflow', 0):
                # BBB
                warn("The '_isAWorkflow' marker attribute for workflow "
                     "definitions is deprecated and will be removed in "
                     "CMF 2.3;  please mark the definition with "
                     "'IWorkflowDefinition' instead.",
                     DeprecationWarning, stacklevel=2)
                wf_ids.append(obj_name)

        return tuple(wf_ids)