Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
DCWorkflow.Transitions.TransitionDefinition Class Reference
Inheritance diagram for DCWorkflow.Transitions.TransitionDefinition:
Inheritance graph
[legend]
Collaboration diagram for DCWorkflow.Transitions.TransitionDefinition:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def getId
def getGuardSummary
def getGuard
def getVarExprText
def getWorkflow
def getAvailableStateIds
def getAvailableScriptIds
def getAvailableVarIds
def manage_properties
def setProperties
def manage_variables
def getVariableExprs
def getWorkflowVariables
def addVariable
def deleteVariables
def setVariables

Public Attributes

 id
 title
 description
 new_state_id
 actbox_name
 actbox_url
 actbox_category

Static Public Attributes

string meta_type = 'Workflow Transition'
tuple security = ClassSecurityInfo()
string title = ''
string description = ''
string new_state_id = ''
 trigger_type = TRIGGER_USER_ACTION
 guard = None
string actbox_name = ''
string actbox_url = ''
string actbox_category = 'workflow'
 var_exprs = None
 script_name = None
 after_script_name = None
tuple manage_options

Static Private Attributes

tuple _properties_form = DTMLFile('transition_properties', _dtmldir)
tuple _variables_form = DTMLFile('transition_variables', _dtmldir)

Detailed Description

Transition definition

Definition at line 36 of file Transitions.py.


Constructor & Destructor Documentation

Definition at line 61 of file Transitions.py.

00061 
00062     def __init__(self, id):
00063         self.id = id


Member Function Documentation

def DCWorkflow.Transitions.TransitionDefinition.addVariable (   self,
  id,
  text,
  REQUEST = None 
)
Add a variable expression.

Definition at line 171 of file Transitions.py.

00171 
00172     def addVariable(self, id, text, REQUEST=None):
00173         '''
00174         Add a variable expression.
00175         '''
00176         if self.var_exprs is None:
00177             self.var_exprs = PersistentMapping()
00178 
00179         expr = None
00180         if text:
00181           expr = Expression(str(text))
00182         self.var_exprs[id] = expr
00183 
00184         if REQUEST is not None:
00185             return self.manage_variables(REQUEST, 'Variable added.')

Here is the call graph for this function:

def DCWorkflow.Transitions.TransitionDefinition.deleteVariables (   self,
  ids = [],
  REQUEST = None 
)
delete a WorkflowVariable from State

Definition at line 186 of file Transitions.py.

00186 
00187     def deleteVariables(self,ids=[],REQUEST=None):
00188         ''' delete a WorkflowVariable from State
00189         '''
00190         ve = self.var_exprs
00191         for id in ids:
00192             if ve.has_key(id):
00193                 del ve[id]
00194 
00195         if REQUEST is not None:
00196             return self.manage_variables(REQUEST, 'Variables deleted.')

Here is the call graph for this function:

Definition at line 95 of file Transitions.py.

00095 
00096     def getAvailableScriptIds(self):
00097         return self.getWorkflow().scripts.keys()

Here is the call graph for this function:

Definition at line 92 of file Transitions.py.

00092 
00093     def getAvailableStateIds(self):
00094         return self.getWorkflow().states.keys()

Here is the call graph for this function:

Definition at line 98 of file Transitions.py.

00098 
00099     def getAvailableVarIds(self):
00100         return self.getWorkflow().variables.keys()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 73 of file Transitions.py.

00073 
00074     def getGuard(self):
00075         if self.guard is not None:
00076             return self.guard
00077         else:
00078             return Guard().__of__(self)  # Create a temporary guard.

Definition at line 67 of file Transitions.py.

00067 
00068     def getGuardSummary(self):
00069         res = None
00070         if self.guard is not None:
00071             res = self.guard.getSummary()
00072         return res

Definition at line 64 of file Transitions.py.

00064 
00065     def getId(self):
00066         return self.id

Definition at line 79 of file Transitions.py.

00079 
00080     def getVarExprText(self, id):
00081         if not self.var_exprs:
00082             return ''
00083         else:
00084             expr = self.var_exprs.get(id, None)
00085             if expr is not None:
00086                 return expr.text
00087             else:
00088                 return ''

Here is the caller graph for this function:

get variable exprs for management UI

Definition at line 146 of file Transitions.py.

00146 
00147     def getVariableExprs(self):
00148         ''' get variable exprs for management UI
00149         '''
00150         ve = self.var_exprs
00151         if ve is None:
00152             return []
00153         else:
00154             ret = []
00155             for key in ve.keys():
00156                 ret.append((key,self.getVarExprText(key)))
00157             return ret

Here is the call graph for this function:

Definition at line 89 of file Transitions.py.

00089 
00090     def getWorkflow(self):
00091         return aq_parent(aq_inner(aq_parent(aq_inner(self))))

Here is the caller graph for this function:

get all variables that are available form
    workflow and not handled yet.

Definition at line 158 of file Transitions.py.

00158 
00159     def getWorkflowVariables(self):
00160         ''' get all variables that are available form
00161             workflow and not handled yet.
00162         '''
00163         wf_vars = self.getAvailableVarIds()
00164         if self.var_exprs is None:
00165                 return wf_vars
00166         ret = []
00167         for vid in wf_vars:
00168             if not self.var_exprs.has_key(vid):
00169                 ret.append(vid)
00170         return ret

Here is the call graph for this function:

def DCWorkflow.Transitions.TransitionDefinition.manage_properties (   self,
  REQUEST,
  manage_tabs_message = None 
)

Definition at line 103 of file Transitions.py.

00103 
00104     def manage_properties(self, REQUEST, manage_tabs_message=None):
00105         '''
00106         '''
00107         return self._properties_form(REQUEST,
00108                                      management_view='Properties',
00109                                      manage_tabs_message=manage_tabs_message,
00110                                      )

Here is the call graph for this function:

def DCWorkflow.Transitions.TransitionDefinition.manage_variables (   self,
  REQUEST,
  manage_tabs_message = None 
)

Definition at line 138 of file Transitions.py.

00138 
00139     def manage_variables(self, REQUEST, manage_tabs_message=None):
00140         '''
00141         '''
00142         return self._variables_form(REQUEST,
00143                                      management_view='Variables',
00144                                      manage_tabs_message=manage_tabs_message,
00145                                      )

Here is the caller graph for this function:

def DCWorkflow.Transitions.TransitionDefinition.setProperties (   self,
  title,
  new_state_id,
  trigger_type = TRIGGER_USER_ACTION,
  script_name = '',
  after_script_name = '',
  actbox_name = '',
  actbox_url = '',
  actbox_category = 'workflow',
  props = None,
  REQUEST = None,
  description = '' 
)

Definition at line 116 of file Transitions.py.

00116 
00117                       props=None, REQUEST=None, description=''):
00118         '''
00119         '''
00120         self.title = str(title)
00121         self.description = str(description)
00122         self.new_state_id = str(new_state_id)
00123         self.trigger_type = int(trigger_type)
00124         self.script_name = str(script_name)
00125         self.after_script_name = str(after_script_name)
00126         g = Guard()
00127         if g.changeFromProperties(props or REQUEST):
00128             self.guard = g
00129         else:
00130             self.guard = None
00131         self.actbox_name = str(actbox_name)
00132         self.actbox_url = str(actbox_url)
00133         self.actbox_category = str(actbox_category)
00134         if REQUEST is not None:
00135             return self.manage_properties(REQUEST, 'Properties changed.')

Here is the caller graph for this function:

def DCWorkflow.Transitions.TransitionDefinition.setVariables (   self,
  ids = [],
  REQUEST = None 
)
set values for Variables set by this state

Definition at line 197 of file Transitions.py.

00197 
00198     def setVariables(self, ids=[], REQUEST=None):
00199         ''' set values for Variables set by this state
00200         '''
00201         if self.var_exprs is None:
00202             self.var_exprs = PersistentMapping()
00203 
00204         ve = self.var_exprs
00205 
00206         if REQUEST is not None:
00207             for id in ve.keys():
00208                 fname = 'varexpr_%s' % id
00209 
00210                 val = REQUEST[fname]
00211                 expr = None
00212                 if val:
00213                     expr = Expression(str(REQUEST[fname]))
00214                 ve[id] = expr
00215 
00216             return self.manage_variables(REQUEST, 'Variables changed.')
00217 
00218 InitializeClass(TransitionDefinition)
00219 

Here is the call graph for this function:


Member Data Documentation

tuple DCWorkflow.Transitions.TransitionDefinition._properties_form = DTMLFile('transition_properties', _dtmldir) [static, private]

Definition at line 101 of file Transitions.py.

tuple DCWorkflow.Transitions.TransitionDefinition._variables_form = DTMLFile('transition_variables', _dtmldir) [static, private]

Definition at line 136 of file Transitions.py.

Definition at line 51 of file Transitions.py.

Definition at line 132 of file Transitions.py.

Definition at line 49 of file Transitions.py.

Definition at line 130 of file Transitions.py.

Definition at line 50 of file Transitions.py.

Definition at line 131 of file Transitions.py.

Definition at line 54 of file Transitions.py.

Definition at line 45 of file Transitions.py.

Definition at line 120 of file Transitions.py.

Definition at line 48 of file Transitions.py.

Definition at line 62 of file Transitions.py.

Initial value:
(
        {'label': 'Properties', 'action': 'manage_properties'},
        {'label': 'Variables', 'action': 'manage_variables'},
        )

Definition at line 56 of file Transitions.py.

string DCWorkflow.Transitions.TransitionDefinition.meta_type = 'Workflow Transition' [static]

Definition at line 39 of file Transitions.py.

Definition at line 46 of file Transitions.py.

Definition at line 121 of file Transitions.py.

Definition at line 53 of file Transitions.py.

tuple DCWorkflow.Transitions.TransitionDefinition.security = ClassSecurityInfo() [static]

Definition at line 41 of file Transitions.py.

Definition at line 44 of file Transitions.py.

Definition at line 119 of file Transitions.py.

Definition at line 47 of file Transitions.py.

Definition at line 52 of file Transitions.py.


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