|
/
Zope
/
gocept svn checkins
/
Archive
/
2006
/
2006-01
/
SVN: r3777 - AlphaFlow/trunk
[
SVN: r3671 - in misc/trunk/WorkflowEditor/docbook:... ]
[
SVN: r3791 - in AlphaFlow/trunk: . Extensions ... ]
SVN: r3777 - AlphaFlow/trunk
Christian Theune <ct(at)gocept.com> |
2006-01-11 10:03:06 |
[ FULL ]
|
Author: ctheune
Date: Wed Jan 11 10:02:57 2006
New Revision: 3777
Modified:
AlphaFlow/trunk/workflowedobject.py
Log:
- Copyright update (and mailinglist check)
Modified: AlphaFlow/trunk/workflowedobject.py
==============================================================================
--- AlphaFlow/trunk/workflowedobject.py (original)
+++ AlphaFlow/trunk/workflowedobject.py Wed Jan 11 10:02:57 2006
(at)(at) -1,4 +1,4 (at)(at)
-# Copyright (c) 2004-2005 gocept gmbh & co. kg
+# Copyright (c) 2004-2006 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""Base workflowed object"""
|
SVN: r3778 - AlphaFlow/trunk
Christian Theune <ct(at)gocept.com> |
2006-01-11 10:03:57 |
[ FULL ]
|
Author: ctheune
Date: Wed Jan 11 10:03:55 2006
New Revision: 3778
Modified:
AlphaFlow/trunk/workflowattr.py
Log:
- another mailinglist test
Modified: AlphaFlow/trunk/workflowattr.py
==============================================================================
--- AlphaFlow/trunk/workflowattr.py (original)
+++ AlphaFlow/trunk/workflowattr.py Wed Jan 11 10:03:55 2006
(at)(at) -1,4 +1,4 (at)(at)
-# Copyright (c) 2005 gocept gmbh & co. kg
+# Copyright (c) 2005-2006 gocept gmbh & co. kg
# See also LICENSE.txt
# $Id$
"""WorkflowAttribute definitions and helpers"""
|
SVN: r3779 - in AlphaFlow/trunk: doc skins/alphaflow_p21
Christian Theune <ct(at)gocept.com> |
2006-01-12 10:23:30 |
[ FULL ]
|
Author: ctheune
Date: Thu Jan 12 10:23:24 2006
New Revision: 3779
Added:
AlphaFlow/trunk/skins/alphaflow_p21/alf_isFallout.py (contents, props
changed)
AlphaFlow/trunk/skins/alphaflow_p21/global_statusmessage.pt (contents,
props changed)
Modified:
AlphaFlow/trunk/doc/HISTORY.txt
Log:
Added an additional very visible status message that remains sticky on a
content object when the assigned workflow is fallen out.
Modified: AlphaFlow/trunk/doc/HISTORY.txt
==============================================================================
--- AlphaFlow/trunk/doc/HISTORY.txt (original)
+++ AlphaFlow/trunk/doc/HISTORY.txt Thu Jan 12 10:23:24 2006
(at)(at) -5,6 +5,9 (at)(at)
AlphaFlow 1.0.3
===============
+ - Added an additional very visible status message that remains sticky on
+ a content object when the assigned workflow is fallen out.
+
- Added mode 'delayed-discriminate'. See manual for details.
- Fixed changed API in 'runAsSystemUser' implementation.
Added: AlphaFlow/trunk/skins/alphaflow_p21/alf_isFallout.py
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/skins/alphaflow_p21/alf_isFallout.py Thu Jan 12 10:23:24
2006
(at)(at) -0,0 +1,15 (at)(at)
+if not hasattr(context, 'isAlphaFlowable'):
+ return False
+
+if not context.isAlphaFlowable():
+ return False
+
+if not context.hasInstanceAssigned():
+ return False
+
+try:
+ instance = context.getInstance()
+except:
+ return False
+
+return instance.state == "fallout"
Added: AlphaFlow/trunk/skins/alphaflow_p21/global_statusmessage.pt
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/skins/alphaflow_p21/global_statusmessage.pt Thu Jan 12
10:23:24 2006
(at)(at) -0,0 +1,23 (at)(at)
+<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en"
+ i18n:domain="plone">
+
+<body>
+
+<!-- THE STATUS MESSAGE DEFINITION -->
+<metal:block define-macro="portal_message">
+ <div class="portalMessage"
+ i18n:domain="plone"
+ tal:define="portal_message request/portal_status_message | nothing"
+ tal:condition="portal_message">
+ <tal:msg tal:content="portal_message" i18n:translate="">Portal
Message</tal:msg>
+ </div>
+
+ <div class="portalMessage" tal:condition="here/alf_isFallout"
+ i18n:translate="description_fallout">
+ The workflow for this object has encountered a problem and was suspended.
+ Please contact the portal administrator.
+ </div>
+</metal:block>
+
+</body>
+</html>
|
SVN: r3780 - in AlphaFlow/trunk: . doc
Daniel Havlik <dh(at)gocept.com> |
2006-01-12 11:27:04 |
[ FULL ]
|
Author: nilo
Date: Thu Jan 12 11:26:56 2006
New Revision: 3780
Modified:
AlphaFlow/trunk/activity.py
AlphaFlow/trunk/doc/HISTORY.txt
AlphaFlow/trunk/instance.py
AlphaFlow/trunk/interfaces.py
Log:
Refactored creation of work items: Activities are now factories and are
able to generate multiple work items at once.
Modified: AlphaFlow/trunk/activity.py
==============================================================================
--- AlphaFlow/trunk/activity.py (original)
+++ AlphaFlow/trunk/activity.py Thu Jan 12 11:26:56 2006
(at)(at) -29,7 +29,7 (at)(at)
from Products.AlphaFlow.importexport import \
DOMExporter, DOMImporter, convert_to_xml
from Products.AlphaFlow.registry import Registry
-
+from Products.AlphaFlow.workitem import workitem_registry
class BaseActivity(PropertyManager, SimpleItem, DOMExporter, DOMImporter):
"""A base class to implement activities"""
(at)(at) -106,7 +106,16 (at)(at)
res.append(process[activity_id].getId())
return res
-
+ def generateWorkItems(self, source, content_object):
+ """Instanciates workitems for this activity.
+ """
+ source_id = source.getId()
+ w_id = utils.generateUniqueId('Workitem')
+ wi_class = workitem_registry.get(self.activity_type)
+
+ wi = wi_class(w_id, self.getId(), content_object)
+ wi.generated_by = source_id
+ return [wi]
#########
# private
Modified: AlphaFlow/trunk/doc/HISTORY.txt
==============================================================================
--- AlphaFlow/trunk/doc/HISTORY.txt (original)
+++ AlphaFlow/trunk/doc/HISTORY.txt Thu Jan 12 11:26:56 2006
(at)(at) -20,6 +20,9 (at)(at)
- Made getActivityTitleOrId() more failure tolerant when workflow
definitions change over time.
+
+ - Refactored creation of work items: Activities are now factories and are
+ able to generate multiple work items at once.
AlphaFlow 1.0.2
===============
Modified: AlphaFlow/trunk/instance.py
==============================================================================
--- AlphaFlow/trunk/instance.py (original)
+++ AlphaFlow/trunk/instance.py Thu Jan 12 11:26:56 2006
(at)(at) -10,6 +10,7 (at)(at)
from StringIO import StringIO
# Zope imports
+from zExceptions.ExceptionFormatter import format_exception
import zExceptions
import zLOG
from Globals import InitializeClass
(at)(at) -26,7 +27,6 (at)(at)
# Sibling imports
from Products.AlphaFlow.interfaces import \
IInstance, IWorkItem, IAlphaFlowed, IDaemonActivity
-from Products.AlphaFlow.workitem import workitem_registry
from Products.AlphaFlow import config, utils
from Products.AlphaFlow.exception import UnknownActivityError
(at)(at) -177,7 +177,7 (at)(at)
except:
info = sys.exc_info()
self.changeState("fallout",
- "Can't start instance. Activity '%s' not found." % m, info)
+ "Can't start instance.", info)
security.declareProtected(config.CONTROL_PROCESS, "reset")
def reset(self, comment):
(at)(at) -600,35 +600,31 (at)(at)
security.declarePrivate('_create_workitems_helper')
def _create_workitems_helper(self, activity_ids, source, content_object):
-
if content_object is None:
# If the workitem that spawns this WI has it's own overriden
# content object, we stick to that if not requested otherwise.
content_object = getattr(source, 'content_object', None)
new = []
+ new_wrapped = []
new_ids = []
-
- source_id = source.getId()
process = self.getProcess()
for activity_id in activity_ids:
- w_id = utils.generateUniqueId('Workitem')
try:
- activity_type = process[activity_id].activity_type
+ activity = process[activity_id]
except KeyError:
raise UnknownActivityError, \
"Activity '%s' does not exist." % activity_id
- wi_class = workitem_registry.get(activity_type)
-
- wi = wi_class(w_id, activity_id, content_object)
- self._setObject(w_id, wi)
- wi = self[w_id]
- wi.generated_by = source_id
- new.append(wi)
- new_ids.append(w_id)
-
- return new_ids, new
+ new.extend(activity.generateWorkItems(source, content_object))
+
+ for wi in new:
+ wi_id = wi.getId()
+ new_ids.append(wi_id)
+ self._setObject(wi_id, wi)
+ new_wrapped.append(self[wi_id])
+
+ return new_ids, new_wrapped
security.declarePrivate('_start_workitems')
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Thu Jan 12 11:26:56 2006
(at)(at) -248,7 +248,7 (at)(at)
def getConfigurationSchema(content):
"""Return the configuration schema. XXX of what?
- This also allows for different activities to have programmatic
+ This also allows for different activities to have programatic
influence on what configuration schemas look like. XXX how?
content: the content object XXX does not seem to be used
(at)(at) -270,6 +270,11 (at)(at)
def acquireActivity():
"""returns the activity instance from the acquisition chain"""
+ def generateWorkItems(source, content_object):
+ """Instanciates workitems for this activity.
+
+ Returns list of workitems.
+ """
#######################
# content related stuff
|
SVN: r3781 - AlphaFlow/trunk/activities
Daniel Havlik <dh(at)gocept.com> |
2006-01-12 11:30:42 |
[ FULL ]
|
Author: nilo
Date: Thu Jan 12 11:30:40 2006
New Revision: 3781
Modified:
AlphaFlow/trunk/activities/decision.py
Log:
corrected a typo
Modified: AlphaFlow/trunk/activities/decision.py
==============================================================================
--- AlphaFlow/trunk/activities/decision.py (original)
+++ AlphaFlow/trunk/activities/decision.py Thu Jan 12 11:30:40 2006
(at)(at) -210,7 +210,7 (at)(at)
return
act = self.getActivity()
self.createWorkItems(act.accept_activity)
- self.changeState("complete", "all necassry assignees accepted")
+ self.changeState("complete", "all necessary assignees accepted")
|
SVN: r3782 - in AlphaFlow/trunk: . activities
Daniel Havlik <dh(at)gocept.com> |
2006-01-12 14:44:46 |
[ FULL ]
|
Author: nilo
Date: Thu Jan 12 14:44:41 2006
New Revision: 3782
Modified:
AlphaFlow/trunk/__init__.py
AlphaFlow/trunk/activities/interfaces.py
AlphaFlow/trunk/activity.py
AlphaFlow/trunk/instance.py
AlphaFlow/trunk/interfaces.py
AlphaFlow/trunk/workitem.py
Log:
added new activity SimpleDecision, which generates an own workitem for every
assignee, and therefore does not need any routing modes (like first_yes,
all_yes...).
Modified: AlphaFlow/trunk/__init__.py
==============================================================================
--- AlphaFlow/trunk/__init__.py (original)
+++ AlphaFlow/trunk/__init__.py Thu Jan 12 14:44:41 2006
(at)(at) -40,7 +40,7 (at)(at)
from activities import \
task, review, permission, version, expression, dcworkflow, \
recursion, notify, alarm, condition, routing, gates, ntask, \
- decision, configuration, parent, switch, roleassign
+ decision, simpledecision, configuration, parent, switch, roleassign
def initialize_content(context):
Modified: AlphaFlow/trunk/activities/interfaces.py
==============================================================================
--- AlphaFlow/trunk/activities/interfaces.py (original)
+++ AlphaFlow/trunk/activities/interfaces.py Thu Jan 12 14:44:41 2006
(at)(at) -102,14 +102,21 (at)(at)
exit ... one of the exit ids
"""
+class ISimpleDecisionActivity(IAssignableActivity):
+ """Decide to accept or reject something.
+ """
+
+ decision_notice = Attribute(
+ "Describes what the user(s) have to decide about.")
-class IDecisionActivity(IAssignableActivity):
+class IDecisionActivity(ISimpleDecisionActivity):
"""Decide to accept or reject.
- First 'no' counts as reasult 'no'.
+ First 'no' counts as result 'no'.
decision_modus says how many 'yes' are needed for a 'yes' result.
"""
-
+
+ decision_modus = Attribute("One of 'first_yes' or 'all_yes'.")
class IDecisionWorkItem(IAssignableWorkItem):
"""WorkItem for DecisionActivity."""
Modified: AlphaFlow/trunk/activity.py
==============================================================================
--- AlphaFlow/trunk/activity.py (original)
+++ AlphaFlow/trunk/activity.py Thu Jan 12 14:44:41 2006
(at)(at) -109,12 +109,9 (at)(at)
def generateWorkItems(self, source, content_object):
"""Instanciates workitems for this activity.
"""
- source_id = source.getId()
w_id = utils.generateUniqueId('Workitem')
wi_class = workitem_registry.get(self.activity_type)
-
wi = wi_class(w_id, self.getId(), content_object)
- wi.generated_by = source_id
return [wi]
#########
Modified: AlphaFlow/trunk/instance.py
==============================================================================
--- AlphaFlow/trunk/instance.py (original)
+++ AlphaFlow/trunk/instance.py Thu Jan 12 14:44:41 2006
(at)(at) -361,6 +361,18 (at)(at)
if workitem is not None:
workitem._af_notified = False
+ security.declareProtected(config.WORK_WITH_PROCESS,
+ "getActivityConfiguration")
+ def getActivityConfiguration(self, field, activity_id, default=None):
+ """Retrieves the configuration for this activity in the context of
+ this instance.
+ """
+ field = "%s_%s" % (activity_id, field)
+ try:
+ value = self.Schema()[field].get(self)
+ except KeyError:
+ value = default
+ return value
##############################
# XXX AT configuration support
(at)(at) -621,6 +633,7 (at)(at)
for wi in new:
wi_id = wi.getId()
new_ids.append(wi_id)
+ wi.generated_by = source.getId()
self._setObject(wi_id, wi)
new_wrapped.append(self[wi_id])
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Thu Jan 12 14:44:41 2006
(at)(at) -275,6 +275,7 (at)(at)
Returns list of workitems.
"""
+
#######################
# content related stuff
(at)(at) -482,6 +483,11 (at)(at)
Returns nothing.
"""
+
+ def getActivityConfiguration(field, activity_id):
+ """Return the configuration for this activity in the context of this
+ process instance.
+ """
class IWorkItem(IContentObjectRetriever):
(at)(at) -556,6 +562,8 (at)(at)
def getActivityConfiguration(field):
"""Return the configuration for this activity in the context of this
process instance.
+
+ Deprecated: use instance.getActivityConfiguration()
"""
def getParent():
Modified: AlphaFlow/trunk/workitem.py
==============================================================================
--- AlphaFlow/trunk/workitem.py (original)
+++ AlphaFlow/trunk/workitem.py Thu Jan 12 14:44:41 2006
(at)(at) -6,6 +6,7 (at)(at)
# Python imports
import sys
import os
+from warnings import warn
# Zope imports
from AccessControl import getSecurityManager, ClassSecurityInfo
(at)(at) -372,13 +373,13 (at)(at)
"""Retrieves the configuration for this activity in the context of
this instance.
"""
- field = "%s_%s" % (self.activity_id, field)
+ warn('Using workitem.getActivityConfiguration is deprecated, use '
+ 'instance.getActivityConfiguration instead.',
+ DeprecationWarning, stacklevel=2)
instance = self.getInstance()
- try:
- value = instance.Schema()[field].get(instance)
- except KeyError:
- value = default
- return value
+ return instance.getActivityConfiguration(field, self.activity_id,
+ default=default)
+
security.declarePrivate("createWorkItems")
def createWorkItems(self, activity_ids, content_object=None):
|
SVN: r3783 - AlphaFlow/trunk
Daniel Havlik <dh(at)gocept.com> |
2006-01-12 14:57:30 |
[ FULL ]
|
Author: nilo
Date: Thu Jan 12 14:57:29 2006
New Revision: 3783
Modified:
AlphaFlow/trunk/workitem.py
Log:
re-added last_triggered_by attribiute to basetalesworkitem, which was lost in
a svn tag...
Modified: AlphaFlow/trunk/workitem.py
==============================================================================
--- AlphaFlow/trunk/workitem.py (original)
+++ AlphaFlow/trunk/workitem.py Thu Jan 12 14:57:29 2006
(at)(at) -613,11 +613,13 (at)(at)
__implements__ = BaseAutomaticWorkItem.__implements__ + \
(ITalesWorkItem, )
security = ClassSecurityInfo()
-
+ last_triggered_by = ''
+
security.declarePrivate('evaluate')
def evaluate(self):
"Evaluate the TALES-Expression."
- activity = self.getActivity()
+ self.last_triggered_by = getToolByName(self,
'portal_membership').getAuthenticatedMember()
+ activity = self.getActivity()
return utils.evaluateTales(self, activity.expression)
InitializeClass(BaseTalesWorkItem)
|
SVN: r3784 - AlphaFlow/trunk/activities
Daniel Havlik <dh(at)gocept.com> |
2006-01-12 15:08:37 |
[ FULL ]
|
Author: nilo
Date: Thu Jan 12 15:08:33 2006
New Revision: 3784
Added:
AlphaFlow/trunk/activities/simpledecision.py
Log:
forgotten adding of simpledecision.py
Added: AlphaFlow/trunk/activities/simpledecision.py
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/activities/simpledecision.py Thu Jan 12 15:08:33 2006
(at)(at) -0,0 +1,202 (at)(at)
+# Copyright (c) 2004-2006 gocept gmbh & co. kg
+# See also LICENSE.txt
+# $Id: decision.py 3781 2006-01-12 10:30:40Z nilo $
+"""Simple Decision activity and work item."""
+
+# Zope imports
+from AccessControl import ClassSecurityInfo, getSecurityManager
+
+# Plone/AT imports
+from Products.Archetypes import public as atapi
+from Products.CMFCore.utils import getToolByName
+
+# Sibling imports
+from Products.AlphaFlow.interfaces import \
+ ISimpleDecisionActivity, IDecisionWorkItem
+from Products.AlphaFlow.workitem import BaseAssignableWorkItem,
registerWorkItem
+from Products.AlphaFlow.activity import BaseAssignableActivity,
registerActivity
+from Products.AlphaFlow import config, utils
+from Products.AlphaFlow.action import Action
+from Products.AlphaFlow.workflowattr import WorkflowAttribute
+
+
+class SimpleDecisionActivity(BaseAssignableActivity):
+ """Decide to accept or reject.
+ """
+
+ __implements__ = (ISimpleDecisionActivity,) + \
+ BaseAssignableActivity.__implements__
+ security = ClassSecurityInfo()
+
+ meta_type = "AlphaFlow Simple Decision Activity"
+ activity_type = nodeName = "simpledecision"
+ icon = "misc_/AlphaFlow/decision"
+
+ attributes = BaseAssignableActivity.attributes + (
+ WorkflowAttribute('decision_notice', 'decision_notice', '',
+ 'Describing the task for the decision.'),
+ WorkflowAttribute('reject_activity', 'reject_activity', (),
+ 'Activity if result is "no".',
+ encoding='ascii', datatype=tuple),
+ WorkflowAttribute('accept_activity', 'accept_activity', (),
+ 'Activity if result is "yes".',
+ encoding='ascii', datatype=tuple),
+ )
+
+
+ configurationSchema = BaseAssignableActivity.configurationSchema.copy()
+ # gets modified by __init__!
+
+
+ _properties = BaseAssignableActivity._properties + \
+ ({'id': 'decision_notice', 'type': 'text', 'mode': 'w'},
+ {'id': 'reject_activity', 'type': 'multiple selection',
+ 'mode': 'w', 'select_variable': 'listActivityIds'},
+ {'id': 'accept_activity', 'type': 'multiple selection',
+ 'mode': 'w', 'select_variable': 'listActivityIds'},
+ )
+
+
+ security.declareProtected(config.EDIT_WORKFLOW, '__init__')
+ def __init__(self, id):
+ SimpleDecisionActivity.inheritedAttribute('__init__')(self, id)
+ if self.configurationSchema:
+ self.configurationSchema.get('assignees').widget =
atapi.MultiSelectionWidget(
+ label="Assigned users",
+ description="Select one or more users who should decide the
document",
+ i18n_description="d_review",
+ format='checkbox',
+ )
+
+ security.declareProtected(config.MANAGE_WORKFLOW, "getPossibleChildren")
+ def getPossibleChildren(self):
+ """Return a list of possible following activities. (List of ids)"""
+ return self.reject_activity + self.accept_activity
+
+ security.declareProtected(config.MANAGE_WORKFLOW,
+ "graphGetPossibleChildren")
+ def graphGetPossibleChildren(self):
+ """Return a list of possible following activities. (List of ids)"""
+ acts = []
+ for act in self.reject_activity:
+ acts.append({'id':act,
+ 'label':'on reject',
+ 'color':'red'})
+ for act in self.accept_activity:
+ acts.append({'id':act,
+ 'color':'green',
+ 'label':'on accept'})
+ return acts
+
+ def generateWorkItems(self, source, content_object):
+ """Instanciates a SimpleDecisionWorkItem for every assignee."""
+ assignees = self._list_relevant_users(source)
+ wis = []
+ for assignee in assignees:
+ w_id = utils.generateUniqueId('Workitem')
+ wi = SimpleDecisionWorkItem(w_id, self.getId(), content_object,
assignee)
+ wis.append(wi)
+
+ return wis
+
+ def _list_relevant_users(self, source):
+ #XXX duplicated code from activity.py, refactor!
+ if self.assigneesKind == 'possible':
+ relevant =
source.getInstance().getActivityConfiguration("assignees",
+ self.getId())
+ if not isinstance(relevant, (list, tuple)):
+ relevant = []
+ else:
+ if self.assigneesExpression is not None:
+ relevant = utils.evaluateTales(self,
+ self.assigneesExpression)
+ groupstool = getToolByName(self, "portal_groups")
+ relevant = utils.expandGroups(groupstool, relevant)
+ else:
+ # we have roles
+ roles = self.roles
+ relevant = source.listMembersWithRolesOnContentObject(roles)
+ return relevant
+
+
+class SimpleDecisionWorkItem(BaseAssignableWorkItem):
+
+ __implements__ = (IDecisionWorkItem,) + \
+ BaseAssignableWorkItem.__implements__
+
+ activity_type = "simpledecision"
+ security = ClassSecurityInfo()
+
+ def __init__(self, id, activity_id, content_object, assignee):
+ SimpleDecisionWorkItem.inheritedAttribute('__init__')\
+ (self, id, activity_id, content_object)
+ self.assignee = assignee
+
+
+ ###########
+ # IWorkItem
+
+ security.declareProtected(config.WORK_WITH_PROCESS, 'getActions')
+ def getActions(self):
+ """Determine all possible actions."""
+ actions = [
+ Action('accept',
+ u'Accept',
+ self.absolute_url(inner=True)+"/accept",
+ self.accept),
+ Action('reject',
+ u'Reject',
+ self.absolute_url(inner=True)+"/reject",
+ self.reject),
+ ]
+ return actions
+
+
+ def listRelevantUsers(self):
+ """return the stored assignee"""
+ return [self.assignee]
+
+
+
+ ###################
+ # IDecisionWorkItem
+
+ security.declareProtected(config.HANDLE_WORKITEM, "reject")
+ def reject(self, REQUEST=None):
+ """Reject"""
+ if self.state != "active":
+ raise ValueError, "Can't reject when not active."
+ try:
+ act = self.getActivity()
+ self.createWorkItems(act.reject_activity)
+ except KeyError:
+ self.changeState("fallout", "Could not find activity: %s" %
+ act)
+ self.changeState("complete", "rejected")
+ self.notifyAssigneesChange()
+ self._update_ui_after_action('Rejected.', REQUEST)
+
+ security.declareProtected(config.HANDLE_WORKITEM, "accept")
+ def accept(self, REQUEST=None):
+ """Accept"""
+ if self.state != "active":
+ raise ValueError, "Can't accept when not active."
+ act = self.getActivity()
+ self.createWorkItems(act.accept_activity)
+ self.changeState("complete", "assignee accepted")
+ self.notifyAssigneesChange()
+ self._update_ui_after_action("Review registered.", REQUEST)
+
+
+ security.declareProtected(config.WORK_WITH_PROCESS, 'getShortInfo')
+ def getShortInfo(self):
+ """Returns a short information text."""
+ content = self.getContentObject()
+ if content is None:
+ info = "n/a"
+ else:
+ info = content.Title()
+
+
+registerActivity(SimpleDecisionActivity)
+registerWorkItem(SimpleDecisionWorkItem)
|
SVN: r3785 - in AlphaFlow/trunk/tests: . workflows
Daniel Havlik <dh(at)gocept.com> |
2006-01-12 16:45:04 |
[ FULL ]
|
Author: nilo
Date: Thu Jan 12 16:44:57 2006
New Revision: 3785
Added:
AlphaFlow/trunk/tests/test_simpledecision.py
AlphaFlow/trunk/tests/workflows/routing_simpledec.alf
AlphaFlow/trunk/tests/workflows/simpledecision.alf
Modified:
AlphaFlow/trunk/tests/test_routing.py
Log:
added breaking test for routing with decisions
Modified: AlphaFlow/trunk/tests/test_routing.py
==============================================================================
--- AlphaFlow/trunk/tests/test_routing.py (original)
+++ AlphaFlow/trunk/tests/test_routing.py Thu Jan 12 16:44:57 2006
(at)(at) -73,6 +73,103 (at)(at)
for wi in wis:
self.failIfEqual(wi.state, "fallout")
+ def test_routing_with_decision(self):
+ portal = self.portal
+ self._create_test_users()
+ self.loginAsPortalOwner()
+ self._import_wf('workflows/routing_simpledec.alf')
+
+ wftool = getToolByName(portal, 'workflow_manager')
+
+ # Create object for instanciation of this process
+ portal.createObject("testdocument", "DummyContent")
+
+ # Initialize the process
+ doc = portal.testdocument
+ doc.assignProcess('test')
+
+ process = doc.getInstance()
+ process.start("testing")
+ self.assertEquals(process.state, "active")
+
+
+ self.login("editor1")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "active")
+
+ self.login("author")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "active")
+
+ self.login("editor3")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "active")
+
+ self.login("editor2")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "complete")
+
+ wis = process.getWorkItems(state=None)
+ for wi in wis:
+ self.failIfEqual(wi.state, "fallout")
+
+ # Do the same process but reject this time
+ self.loginAsPortalOwner()
+ doc.assignProcess('test')
+
+ process = doc.getInstance()
+ process.start("testing")
+ self.assertEquals(process.state, "active")
+
+ self.login("author")
+ doc.getWorkItemsForCurrentUser()[0].reject()
+ self.assertEquals(process.state, "active")
+
+ self.login("editor1")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "active")
+
+ self.login("editor2")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "active")
+
+ self.login("editor3")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "complete")
+
+ wis = process.getWorkItems(state=None)
+ for wi in wis:
+ self.failIfEqual(wi.state, "fallout")
+
+ # Do the same process but editor2 rejects this time
+ self.loginAsPortalOwner()
+ doc.assignProcess('test')
+
+ process = doc.getInstance()
+ process.start("testing")
+ self.assertEquals(process.state, "active")
+
+ self.login("author")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "active")
+
+ self.login("editor1")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "active")
+
+ self.login("editor2")
+ doc.getWorkItemsForCurrentUser()[0].reject()
+ self.assertEquals(process.state, "active")
+
+ self.login("editor3")
+ doc.getWorkItemsForCurrentUser()[0].accept()
+ self.assertEquals(process.state, "complete")
+
+ wis = process.getWorkItems(state=None)
+ for wi in wis:
+ self.failIfEqual(wi.state, "fallout")
+
+
def test_delayed_discriminator(self):
portal = self.portal
self._create_test_users()
Added: AlphaFlow/trunk/tests/test_simpledecision.py
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/tests/test_simpledecision.py Thu Jan 12 16:44:57 2006
(at)(at) -0,0 +1,101 (at)(at)
+# Copyright (c) 2005 gocept gmbh & co. kg
+# See also LICENSE.txt
+# $Id: test_decision.py 3642 2005-10-06 08:34:43Z zagy $
+
+
+import common
+import unittest
+
+# from DateTime import DateTime
+from Testing import ZopeTestCase
+
+from Products.CMFCore.utils import getToolByName
+
+from Products.AlphaFlow.tests.AlphaFlowTestCase import AlphaFlowTestCase
+from Products.AlphaFlow.interfaces import IDecisionWorkItem,
ISimpleDecisionActivity
+from Products.AlphaFlow.activities.simpledecision import
SimpleDecisionWorkItem, SimpleDecisionActivity
+from Products.AlphaFlow.exception import ConfigurationError
+
+class SimpleDecisionTest(AlphaFlowTestCase):
+
+ interfaces_to_test = [
+ (IDecisionWorkItem, SimpleDecisionWorkItem),
+ (ISimpleDecisionActivity, SimpleDecisionActivity)
+ ]
+
+ def _init_object(self):
+ # Creates a simple workflow
+ portal = self.portal
+ self._create_test_users()
+ self.loginAsPortalOwner()
+ self._import_wf('workflows/simpledecision.alf')
+
+ wftool = getToolByName(portal, 'workflow_manager')
+
+ self.login("author")
+ mtool = getToolByName(portal, 'portal_membership')
+ home = mtool.getHomeFolder("author")
+ # Create object for instanciation of this process
+ home.createObject("testdocument", "DummyContent")
+
+ # Initialize the process
+ doc = home.testdocument
+ doc.manage_addLocalRoles('editor1', ['Reviewer'])
+ doc.manage_addLocalRoles('editor2', ['Reviewer'])
+ doc.manage_addLocalRoles('editor3', ['Reviewer'])
+ doc.assignProcess('test')
+ return doc
+
+
+ def _get_object(self):
+ portal = self.portal
+ mtool = getToolByName(portal, 'portal_membership')
+ home = mtool.getHomeFolder("author")
+ return home.testdocument
+
+ def _decide(self, doc, action):
+ instance = doc.getInstance()
+ wi = instance.getWorkItems()[0]
+ wi.getActionById(action)()
+
+
+ def test_simpledecision(self):
+ doc = self._init_object()
+ instance = doc.getInstance()
+ instance.start("testing")
+ self.assertEqual(instance.state, "active")
+
+ wis = instance.getWorkItems(state='active')
+ self.assertEqual(1, len(wis)) # configuration
+ self.assertEqual('config_deci_1', wis[0].getActivity().getId())
+ instance.deci_1_assignees = ["editor1", "editor3"]
+ wis[0].configure()
+
+ wis = instance.getWorkItems(state='active')
+ self.assertEqual(2, len(wis))
+ wis[0].reject()
+ wis[1].accept()
+
+ wis = instance.getWorkItems(state='active')
+ self.assertEqual(3, len(wis))
+ wis[0].accept()
+ wis[1].accept()
+ wis[2].reject()
+
+ wis = instance.getWorkItems(state='active')
+ self.assertEqual(2, len(wis))
+ wis[0].accept()
+ wis[1].accept()
+
+ wis = instance.getWorkItems(state='active')
+ self.assertEqual(0, len(wis))
+ self.assertEqual('complete', instance.state)
+
+def test_suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(SimpleDecisionTest))
+ return suite
+
+if __name__ == '__main__':
+ framework()
+
Added: AlphaFlow/trunk/tests/workflows/routing_simpledec.alf
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/tests/workflows/routing_simpledec.alf Thu Jan 12 16:44:57
2006
(at)(at) -0,0 +1,45 (at)(at)
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<workflow id="testworkflow"
+ title="routing_simpledec"
+ startActivity="review"
+ onlyAllowRoles="Manager Reviewer">
+
+ <route id="review"
+ startActivity="visible"
+ title="4 Decisions">
+
+ <decision id="review_decision"
+ decision_notice="review_decision"
+ decision_modus="all_yes"
+ reject_activity="reject"
+ accept_activity="accept">
+ <assignees kind="actual"
expression="python:['author']"/>
+ </decision>
+
+
+ <simpledecision id="review_simpledecision"
+ decision_notice="review_simpledecision"
+ reject_activity="reject"
+ accept_activity="accept">
+ <assignees kind="actual"
expression="python:['editor1','editor2','editor3']"/>
+ </simpledecision>
+
+
+ <gate id="reject"
+ title="Reject review"
+ mode="delayed-discriminate"
+ continue_activity="private" />
+
+ <gate id="accept"
+ title="Accept review"
+ mode="synchronizing-merge"
+ continue_activity="public" />
+
+ </route>
+
+ <dcworkflow id="visible" status="visible" />
+ <dcworkflow id="private" status="private" />
+ <dcworkflow id="public" status="published" />
+
+</workflow>
Added: AlphaFlow/trunk/tests/workflows/simpledecision.alf
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/tests/workflows/simpledecision.alf Thu Jan 12 16:44:57 2006
(at)(at) -0,0 +1,39 (at)(at)
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<!DOCTYPE workflow SYSTEM "../../schemas/alphaflow.dtd">
+<workflow
+ id="testworkflow"
+ startActivity="config_deci_1"
+ onlyAllowRoles="Manager Reviewer Member">
+
+<configuration id="config_deci_1"
+ configures="deci_1"
+ continue_activity="deci_1"
+ />
+
+ <simpledecision id="deci_1"
+ decision_notice="decision with possible roles"
+ accept_activity="deci_2"
+ reject_activity="private">
+ <assignees kind="possible" roles="Reviewer" />
+ </simpledecision>
+
+
+ <simpledecision id="deci_2"
+ decision_notice="decision with actual roles"
+ accept_activity="public"
+ reject_activity="deci_3">
+ <assignees kind="actual" roles="Reviewer" />
+ </simpledecision>
+
+ <simpledecision id="deci_3"
+ decision_notice="decision with assignees expression"
+ accept_activity="public"
+ reject_activity="private">
+ <assignees kind="actual" expression="python:['editor1', 'editor2']"
/>
+ </simpledecision>
+
+ <dcworkflow id="private" status="private" />
+ <dcworkflow id="public" status="public" />
+
+</workflow>
|
SVN: r3786 - AlphaFlow/trunk/activities
Christian Theune <ct(at)gocept.com> |
2006-01-12 17:15:51 |
[ FULL ]
|
Author: ctheune
Date: Thu Jan 12 17:15:41 2006
New Revision: 3786
Modified:
AlphaFlow/trunk/activities/gates.py
AlphaFlow/trunk/activities/interfaces.py
AlphaFlow/trunk/activities/routing.py
Log:
- fixed routing for new work item generation procedure
Modified: AlphaFlow/trunk/activities/gates.py
==============================================================================
--- AlphaFlow/trunk/activities/gates.py (original)
+++ AlphaFlow/trunk/activities/gates.py Thu Jan 12 17:15:41 2006
(at)(at) -10,7 +10,8 (at)(at)
# Sibling imports
from Products.AlphaFlow.workitem import registerWorkItem, BaseWorkItem
from Products.AlphaFlow.activity import registerActivity,
BaseAutomaticActivity
-from Products.AlphaFlow.interfaces import IDaemonActivity, IGateActivity
+from Products.AlphaFlow.interfaces import \
+ IDaemonActivity, IGateActivity, IGateWorkItem
from Products.AlphaFlow.workflowattr import WorkflowAttribute
from Products.AlphaFlow import config
(at)(at) -54,6 +55,8 (at)(at)
security = ClassSecurityInfo()
+ __implements__ = (IGateWorkItem,) + BaseWorkItem.__implements__
+
activity_type = "gate"
####################
(at)(at) -111,14 +114,13 (at)(at)
routing_start = self.getParent()
if not workitem.isChildOf(workitem=routing_start):
return None
-
- possible_routes = [ self.getInstance()[x] for x in
routing_start.generated_workitems ]
- for candidate in possible_routes:
- if not candidate.activity_id in
routing_start.getActivity().routes:
- continue
+
+ instance = self.getInstance()
+ for candidate_id in routing_start.opened_routes:
+ candidate = instance[candidate_id]
if (workitem == candidate) or \
workitem.isChildOf(workitem=candidate):
- return candidate.activity_id
+ return candidate_id
security.declarePrivate('_rememberTrigger')
def _rememberTrigger(self, triggering_workitem, route):
(at)(at) -159,7 +161,7 (at)(at)
security.declarePrivate('_getAllRoutes')
def _getAllRoutes(self):
- return list(tuple(self.getParent().getActivity().routes))
+ return list(tuple(self.getParent().opened_routes))
security.declareProtected(config.WORK_WITH_PROCESS,
'estimateRelevantUsers')
def estimateRelevantUsers(self):
Modified: AlphaFlow/trunk/activities/interfaces.py
==============================================================================
--- AlphaFlow/trunk/activities/interfaces.py (original)
+++ AlphaFlow/trunk/activities/interfaces.py Thu Jan 12 17:15:41 2006
(at)(at) -60,6 +60,8 (at)(at)
class IRoutingWorkItem(IWorkItem):
"""a Routing workitem"""
+ opened_routes = Attribute("A list of work item ids that are opened
routes.")
+
##############################################
# assignable activity and work item interfaces
(at)(at) -204,6 +206,8 (at)(at)
class IGateActivity(IAutomaticActivity):
"""Gate to support routing mechanisms."""
+class IGateWorkItem(IWorkItem):
+ """Gate to support routing mechanisms."""
class IDCWorkFlowActivity(IAutomaticActivity):
"""simulates the DC Workflow Changes the state on a document to a "DC
Modified: AlphaFlow/trunk/activities/routing.py
==============================================================================
--- AlphaFlow/trunk/activities/routing.py (original)
+++ AlphaFlow/trunk/activities/routing.py Thu Jan 12 17:15:41 2006
(at)(at) -13,7 +13,8 (at)(at)
registerActivity, BaseActivity, activity_registry
from Products.AlphaFlow import config
from Products.AlphaFlow.utils import killWorkItemRecursively
-from Products.AlphaFlow.interfaces import IRoutingActivity, IRoutingWorkItem
+from Products.AlphaFlow.interfaces import \
+ IRoutingActivity, IRoutingWorkItem, IGateWorkItem
from Products.AlphaFlow.workflowattr import WorkflowAttribute
(at)(at) -107,15 +108,18 (at)(at)
activity_type = "route"
+
######################
# IWorkItem
+ opened_routes = ()
+
security.declarePrivate("onStart")
def onStart(self):
"""Start the gate daemons and route work items
"""
+ self.opened_routes = self.createWorkItems(self.getActivity().routes)
self.createWorkItems(self.getActivity().gates)
- self.createWorkItems(self.getActivity().routes)
security.declarePrivate("notifyWorkItemStateChange")
def notifyWorkItemStateChange(self, workitem):
|
SVN: r3787 - ZNagios/trunk
Christian Theune <ct(at)gocept.com> |
2006-01-13 10:37:21 |
[ FULL ]
|
Author: ctheune
Date: Fri Jan 13 10:37:17 2006
New Revision: 3787
Modified:
ZNagios/trunk/__init__.py
Log:
- Fixed syntax error (typo)
Modified: ZNagios/trunk/__init__.py
==============================================================================
--- ZNagios/trunk/__init__.py (original)
+++ ZNagios/trunk/__init__.py Fri Jan 13 10:37:17 2006
(at)(at) -18,7 +18,7 (at)(at)
result += "database: %s\n" % int(size)
# references
- all = self.Control_Panel.DebugInfo.refcount()
+ all = self.Control_Panel.DebugInfo.refcount()
size = 0
for v,n in all:
size += v
|
SVN: r3788 - in AlphaFlow/trunk: . doc/manual tests
Christian Theune <ct(at)gocept.com> |
2006-01-13 18:26:59 |
[ FULL ]
|
Author: ctheune
Date: Fri Jan 13 18:26:53 2006
New Revision: 3788
Modified:
AlphaFlow/trunk/doc/manual/admin.tex
AlphaFlow/trunk/processmanager.py
AlphaFlow/trunk/tests/test_processmanager.py
Log:
- Extended cleanup feature to also remove process instances that have no
process available.
Modified: AlphaFlow/trunk/doc/manual/admin.tex
==============================================================================
--- AlphaFlow/trunk/doc/manual/admin.tex (original)
+++ AlphaFlow/trunk/doc/manual/admin.tex Fri Jan 13 18:26:53 2006
(at)(at) -116,7 +116,7 (at)(at)
\begin{memberdesc}{Clean terminated and stale instances} Removes workflow
instances that are no longer of interest. Terminated instances are those
cast away by a manager, stale instances those whose content object no
- longer exists.
+ longer exists or instances where the process definition does not exist.
\end{memberdesc}
\begin{memberdesc}{Run sanity check}
Modified: AlphaFlow/trunk/processmanager.py
==============================================================================
--- AlphaFlow/trunk/processmanager.py (original)
+++ AlphaFlow/trunk/processmanager.py Fri Jan 13 18:26:53 2006
(at)(at) -133,11 +133,14 (at)(at)
def manage_cleanup(self, REQUEST=None):
"Clean up all terminated instances and everything with a missing
object"
clean = []
+ process_ids = []
for instance in self.instances.objectValues():
if instance.state == "terminated":
clean.append(instance.getId())
elif instance.getContentObject() is None:
clean.append(instance.getId())
+ elif instance.process_id not in self.processes.objectIds():
+ clean.append(instance.getId())
self.instances.manage_delObjects(clean)
self.getParentNode().workflow_catalog.refreshCatalog(clear=1)
if REQUEST is not None:
Modified: AlphaFlow/trunk/tests/test_processmanager.py
==============================================================================
--- AlphaFlow/trunk/tests/test_processmanager.py (original)
+++ AlphaFlow/trunk/tests/test_processmanager.py Fri Jan 13 18:26:53 2006
(at)(at) -64,6 +64,17 (at)(at)
self.assertRaises(KeyError, pm.getInstance, "tralalala")
self.failUnless(instance.aq_base is
pm.getInstance(instance.getId()).aq_base)
+ def test_clean(self):
+ self._import_wf('workflows/permission.alf')
+ portal = self.portal
+ pm = portal.workflow_manager
+ doc = self.create(portal, 'DummyContent', 'doc',)
+ doc.assignProcess('test')
+
+ # We delete the definition and check that the instance is removed by
the cleanup script
+ pm.processes.manage_delObjects(['test'])
+ pm.manage_cleanup()
+ self.assertEquals(False, doc.hasInstanceAssigned())
def test_suite():
suite = unittest.TestSuite()
|
SVN: r3789 - in AlphaFlow/trunk/doc: . manual
Christian Theune <ct(at)gocept.com> |
2006-01-16 14:01:24 |
[ FULL ]
|
Author: ctheune
Date: Mon Jan 16 14:01:17 2006
New Revision: 3789
Modified:
AlphaFlow/trunk/doc/HISTORY.txt
AlphaFlow/trunk/doc/manual/Makefile
AlphaFlow/trunk/doc/manual/api.tex
AlphaFlow/trunk/doc/manual/manual.tex
Log:
Updated manual for new API changes.
Modified: AlphaFlow/trunk/doc/HISTORY.txt
==============================================================================
--- AlphaFlow/trunk/doc/HISTORY.txt (original)
+++ AlphaFlow/trunk/doc/HISTORY.txt Mon Jan 16 14:01:17 2006
(at)(at) -5,6 +5,9 (at)(at)
AlphaFlow 1.0.3
===============
+ - Changed route and gate work items to reflect the new work item
+ generation model.
+
- Added an additional very visible status message that remains sticky on
a content object when the assigned workflow is fallen out.
Modified: AlphaFlow/trunk/doc/manual/Makefile
==============================================================================
--- AlphaFlow/trunk/doc/manual/Makefile (original)
+++ AlphaFlow/trunk/doc/manual/Makefile Mon Jan 16 14:01:17 2006
(at)(at) -1,6 +1,6 (at)(at)
# Makefile für Jucon-Handbuch
-MKHOWTO="/home/ctheune/tmp/Python-2.4.1/Doc/tools/mkhowto"
+MKHOWTO="/home/ctheune/tmp/Python-2.4.2/Doc/tools/mkhowto"
.PHONY: all pdf html clean
Modified: AlphaFlow/trunk/doc/manual/api.tex
==============================================================================
--- AlphaFlow/trunk/doc/manual/api.tex (original)
+++ AlphaFlow/trunk/doc/manual/api.tex Mon Jan 16 14:01:17 2006
(at)(at) -349,6 +349,22 (at)(at)
Returns the activity instance from the acquisition chain.
\end{funcdesc}
+ \begin{funcdesc}{generateWorkItems}{source, content\_object}
+ Instanciates work items for an activity.
+
+ Returns a list of work items.
+
+ This method works as a factory to create work items for an activity
+ when ``createWorkItems'' is called.
+
+ The \class{BaseActivity} has a basic method that creates a single work
+ item that is identified by the \var{activity_type}. In more complex
situations
+ this method allows to create work items of any type and in any amount
+ while only a single activity is configured.
+
+ An example of a custom \method{generateWorkItems} method can be found
+ in \file{Products/AlphaFlow/activities/simpledecision.py}.
+ \end{funcdesc}
\end{classdesc}
Modified: AlphaFlow/trunk/doc/manual/manual.tex
==============================================================================
--- AlphaFlow/trunk/doc/manual/manual.tex (original)
+++ AlphaFlow/trunk/doc/manual/manual.tex Mon Jan 16 14:01:17 2006
(at)(at) -26,8 +26,8 (at)(at)
% the date to \today can be used during draft
% stages to make it easier to handle versions.
-\release{1.0.2} % release version; this is used to define the
- % \version macro
+\release{1.0.3} % release version; this is used to define the
+ % \version macro
\makeindex % tell \index to actually write the .idx file
|
SVN: r3790 - in AlphaFlow/trunk: . activities
Christian Theune <ct(at)gocept.com> |
2006-01-16 14:01:49 |
[ FULL ]
|
Author: ctheune
Date: Mon Jan 16 14:01:45 2006
New Revision: 3790
Modified:
AlphaFlow/trunk/activities/gates.py
AlphaFlow/trunk/activities/routing.py
AlphaFlow/trunk/interfaces.py
Log:
- changed behaviour of gates and routes to match new work item generation
model
Modified: AlphaFlow/trunk/activities/gates.py
==============================================================================
--- AlphaFlow/trunk/activities/gates.py (original)
+++ AlphaFlow/trunk/activities/gates.py Mon Jan 16 14:01:45 2006
(at)(at) -64,7 +64,7 (at)(at)
security.declarePrivate('onStart')
def onStart(self):
- self.open_routes = self._getAllRoutes()
+ self.closed_routes = []
self.delayed_discriminator = False
security.declarePrivate("beforeCreationItems")
(at)(at) -77,7 +77,7 (at)(at)
if route is None:
return []
- # Don't allow this gate to be generated again
+ all_routes = self._getAllRoutes()
for wi in items:
if wi == self.activity_id:
(at)(at) -89,16 +89,16 (at)(at)
process = self.getProcess()
new_activity = process[wi]
if isinstance(new_activity, GateActivity):
- open_routes = self.open_routes
- if route in open_routes:
- open_routes.remove(route)
- if len(open_routes) == 0 and self.delayed_discriminator:
+ closed_routes = self.closed_routes
+ if not route in self.closed_routes:
+ closed_routes.append(route)
+ if len(closed_routes) == len(all_routes) and
self.delayed_discriminator:
self._doTrigger(parent, route)
self.changeState("complete",
"Gate '%s' triggered and completed after "
"route '%s'" % (self.activity_id, route))
self.delayed_discriminator = False
- self.open_routes = open_routes
+ self.closed_routes = closed_routes
return vote_no
(at)(at) -125,32 +125,33 (at)(at)
security.declarePrivate('_rememberTrigger')
def _rememberTrigger(self, triggering_workitem, route):
mode = self.getActivity().mode
- open_routes = self.open_routes
- if not route in open_routes:
+ all_routes = self._getAllRoutes()
+ closed_routes = self.closed_routes
+ if route in closed_routes:
return
if mode == MULTI_MERGE:
- open_routes.remove(route)
+ closed_routes.append(route)
self._doTrigger(triggering_workitem, route)
- if len(open_routes) == 0:
+ if len(closed_routes) == len(all_routes):
self.changeState("complete", "Gate '%s' found by route '%s'" %
(self.activity_id, route))
elif mode == DISCRIMINATE:
- if len(open_routes) == len(self._getAllRoutes()):
+ if len(closed_routes) == 0:
self._doTrigger(triggering_workitem, route)
self.changeState("complete", "Gate '%s' found by route '%s'" %
(self.activity_id, route))
- open_routes.remove(route)
+ closed_routes.append(route)
elif mode == DELAYED_DISCRIMINATE:
self.delayed_discriminator = True
elif mode == SYNCHRONIZING_MERGE:
- open_routes.remove(route)
- if len(open_routes) == 0:
+ closed_routes.append(route)
+ if len(closed_routes) == len(all_routes):
self._doTrigger(triggering_workitem, route)
self.changeState("complete", "Gate '%s' found by route '%s'" %
(self.activity_id, route))
else:
self.changeState("fallout", "Unknown gate mode: '%s'" % mode)
- self.open_routes = open_routes
+ self.closed_routes = closed_routes
security.declarePrivate('_doTrigger')
def _doTrigger(self, triggering_workitem, route):
Modified: AlphaFlow/trunk/activities/routing.py
==============================================================================
--- AlphaFlow/trunk/activities/routing.py (original)
+++ AlphaFlow/trunk/activities/routing.py Mon Jan 16 14:01:45 2006
(at)(at) -118,8 +118,8 (at)(at)
def onStart(self):
"""Start the gate daemons and route work items
"""
- self.opened_routes = self.createWorkItems(self.getActivity().routes)
self.createWorkItems(self.getActivity().gates)
+ self.opened_routes = self.createWorkItems(self.getActivity().routes)
security.declarePrivate("notifyWorkItemStateChange")
def notifyWorkItemStateChange(self, workitem):
Modified: AlphaFlow/trunk/interfaces.py
==============================================================================
--- AlphaFlow/trunk/interfaces.py (original)
+++ AlphaFlow/trunk/interfaces.py Mon Jan 16 14:01:45 2006
(at)(at) -271,9 +271,9 (at)(at)
"""returns the activity instance from the acquisition chain"""
def generateWorkItems(source, content_object):
- """Instanciates workitems for this activity.
+ """Instanciates work items for this activity.
- Returns list of workitems.
+ Returns list of work items.
"""
|
SVN: r3792 - AlphaFlow/trunk/doc
Daniel Havlik <dh(at)gocept.com> |
2006-01-18 13:08:17 |
[ FULL ]
|
Author: nilo
Date: Wed Jan 18 13:08:13 2006
New Revision: 3792
Modified:
AlphaFlow/trunk/doc/ROADMAP.txt
Log:
added removing compatibility to 2.0.5 with 1.1
Modified: AlphaFlow/trunk/doc/ROADMAP.txt
==============================================================================
--- AlphaFlow/trunk/doc/ROADMAP.txt (original)
+++ AlphaFlow/trunk/doc/ROADMAP.txt Wed Jan 18 13:08:13 2006
(at)(at) -16,6 +16,8 (at)(at)
- Allow sub-processes, check cancellation patterns
- Code cleanup, refactoring
+
+ - requires Plone >= 2.1 (2.0.5 no longer supported)
1.2
---
|
SVN: r3793 - AlphaFlow/trunk/doc
Christian Theune <ct(at)gocept.com> |
2006-01-18 13:16:37 |
[ FULL ]
|
Author: ctheune
Date: Wed Jan 18 13:16:32 2006
New Revision: 3793
Added:
AlphaFlow/trunk/doc/COMPATIBILITY.txt (contents, props changed)
Log:
- Added some compatibility notes
Added: AlphaFlow/trunk/doc/COMPATIBILITY.txt
==============================================================================
--- (empty file)
+++ AlphaFlow/trunk/doc/COMPATIBILITY.txt Wed Jan 18 13:16:32 2006
(at)(at) -0,0 +1,26 (at)(at)
+=============================
+AlphaFlow compatibility notes
+=============================
+
+AlphaFlow is beeing checked repeatedly against multiple platforms. This
+AlphaFlow release is known to be compatible with:
+
+- Zope 2.7 and Zope 2.8
+- Windows 2000 and Linux
+- Plone 2.0.5, Plone 2.1.0, Plone 2.1.1, Plone 2.1.2
+
+Plone 2.0.5
+===========
+
+The compatibility to Plone 2.0.5 is given on a functional level. The user
+interface has some restrictions, though.
+
+Test environments
+=================
+
+Automated tests are run on the following platform combinations:
+
+- Zope 2.7, Plone 2.0.5, Gentoo Linux, Python 2.3.5
+- Zope 2.8, Plone 2.1, Gentoo Linux, Python 2.4
+- Zope 2.8, Plone 2.1, Windows 2000, Python 2.4
+
|
SVN: r3795 - AlphaFlow/trunk
Christian Theune <ct(at)gocept.com> |
2006-01-18 13:25:50 |
[ FULL ]
|
Author: ctheune
Date: Wed Jan 18 13:25:46 2006
New Revision: 3795
Modified:
AlphaFlow/trunk/version.txt
Log:
- bumping version
Modified: AlphaFlow/trunk/version.txt
==============================================================================
--- AlphaFlow/trunk/version.txt (original)
+++ AlphaFlow/trunk/version.txt Wed Jan 18 13:25:46 2006
(at)(at) -1 +1 (at)(at)
-1.0.3 (unreleased)
+1.0.3rc1
|
SVN: r3800 - glome/trunk
Christian Zagrodnick <cz(at)gocept.com> |
2006-01-23 15:58:52 |
[ FULL ]
|
Author: zagy
Date: Mon Jan 23 15:58:47 2006
New Revision: 3800
Modified:
glome/trunk/extfilecontent.py
Log:
made extfilecontent not global_allow -- enable if you need in installer
Modified: glome/trunk/extfilecontent.py
==============================================================================
--- glome/trunk/extfilecontent.py (original)
+++ glome/trunk/extfilecontent.py Mon Jan 23 15:58:47 2006
(at)(at) -34,7 +34,7 (at)(at)
archetype_name = portal_type = meta_type = 'ExtFileContent'
security = ClassSecurityInfo()
- global_allow = True
+ global_allow = False # if you want it addable, enable in *YOUR* installer
actions = (
{
|
SVN: r3801 - glome/trunk
Christian Zagrodnick <cz(at)gocept.com> |
2006-01-23 15:59:26 |
[ FULL ]
|
Author: zagy
Date: Mon Jan 23 15:59:24 2006
New Revision: 3801
Modified:
glome/trunk/aftypes.py
Log:
the alftypes are not globally allowed by default now -- you enable them via
glome_tool or you rown installer
Modified: glome/trunk/aftypes.py
==============================================================================
--- glome/trunk/aftypes.py (original)
+++ glome/trunk/aftypes.py Mon Jan 23 15:59:24 2006
(at)(at) -69,7 +69,8 (at)(at)
'portal_type': glome_name,
'__implements__': AlphaFlowed.__implements__ + at.__implements__,
'security': ClassSecurityInfo(),
- '__module__': __name__
+ '__module__': __name__,
+ 'global_allow': False,
})
additional_schema = schemaExtensions.get(glome_name)
if additional_schema is not None:
(at)(at) -103,6 +104,7 (at)(at)
documentBaseClass.__implements__
security = ClassSecurityInfo()
+ global_allow = False
schema = documentBaseClass.schema.copy()
schema['text'].accessor = "getText"
|
|