Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.contentrules.actions.workflow.WorkflowActionExecutor Class Reference

List of all members.

Public Member Functions

def __init__
def __call__
def error

Public Attributes

 context
 element
 event

Detailed Description

The executor for this action.

Definition at line 45 of file workflow.py.


Constructor & Destructor Documentation

def plone.app.contentrules.actions.workflow.WorkflowActionExecutor.__init__ (   self,
  context,
  element,
  event 
)

Definition at line 51 of file workflow.py.

00051 
00052     def __init__(self, context, element, event):
00053         self.context = context
00054         self.element = element
00055         self.event = event

Here is the caller graph for this function:


Member Function Documentation

Definition at line 56 of file workflow.py.

00056 
00057     def __call__(self):
00058         portal_workflow = getToolByName(self.context, 'portal_workflow', None)
00059         if portal_workflow is None:
00060             return False
00061             
00062         obj = self.event.object
00063         
00064         try:
00065             portal_workflow.doActionFor(obj, self.element.transition)
00066         except ConflictError, e:
00067             raise e
00068         except Exception, e:
00069             self.error(obj, str(e))
00070             return False
00071         
00072         return True 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 73 of file workflow.py.

00073 
00074     def error(self, obj, error):
00075         request = getattr(self.context, 'REQUEST', None)
00076         if request is not None:
00077             title = utils.pretty_title_or_id(obj, obj)
00078             message = _(u"Unable to change state of ${name} as part of content rule 'workflow' action: ${error}",
00079                           mapping={'name' : title, 'error' : error})
00080             IStatusMessage(request).addStatusMessage(message, type="error")
        

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 52 of file workflow.py.

Definition at line 53 of file workflow.py.

Definition at line 54 of file workflow.py.


The documentation for this class was generated from the following file: