reorganize cybertools.process

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1282 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2006-08-02 19:22:43 +00:00
parent 496054f84c
commit 6cabe58f9f
4 changed files with 18 additions and 18 deletions

View file

@ -53,9 +53,9 @@ Manage processes
The classes used in this package are just adapters to IConcept. The classes used in this package are just adapters to IConcept.
>>> from loops.process.definition import ProcessDefinition >>> from loops.process.definition import Process
>>> from cybertools.process.interfaces import IProcessDefinition >>> from cybertools.process.interfaces import IProcess
>>> component.provideAdapter(ProcessDefinition, (IConcept,), IProcessDefinition) >>> component.provideAdapter(Process, (IConcept,), IProcess)
We start with creating a process definition. We start with creating a process definition.
Note that in order to discern the concepts created Note that in order to discern the concepts created
@ -65,7 +65,7 @@ the variables:
>>> from loops.concept import Concept >>> from loops.concept import Concept
>>> myProcessC = concepts['myProcess'] = Concept(u'A Simple Process') >>> myProcessC = concepts['myProcess'] = Concept(u'A Simple Process')
>>> myProcessC.conceptType = process >>> myProcessC.conceptType = process
>>> myProcess = IProcessDefinition(myProcessC) >>> myProcess = IProcess(myProcessC)
Fin de partie Fin de partie

View file

@ -8,15 +8,15 @@
<!-- process/workflow management stuff --> <!-- process/workflow management stuff -->
<zope:adapter factory="loops.process.definition.ProcessDefinition" <zope:adapter factory="loops.process.definition.Process"
provides="cybertools.process.interfaces.IProcessDefinition" provides="cybertools.process.interfaces.IProcess"
trusted="True" /> trusted="True" />
<zope:class class="loops.process.definition.ProcessDefinition"> <zope:class class="loops.process.definition.Process">
<require permission="zope.View" <require permission="zope.View"
interface="cybertools.process.interfaces.IProcessDefinition" /> interface="cybertools.process.interfaces.IProcess" />
<require permission="zope.ManageContent" <require permission="zope.ManageContent"
set_schema="cybertools.process.interfaces.IProcessDefinition" /> set_schema="cybertools.process.interfaces.IProcess" />
</zope:class> </zope:class>
<!-- setup --> <!-- setup -->

View file

@ -30,15 +30,15 @@ from zope.interface import implements
from zope.cachedescriptors.property import Lazy from zope.cachedescriptors.property import Lazy
from cybertools.typology.interfaces import IType from cybertools.typology.interfaces import IType
from cybertools.process.interfaces import IProcessDefinition from cybertools.process.interfaces import IProcess
from cybertools.process.definition import ProcessDefinition as BaseProcessDefinition from cybertools.process.definition import Process as BaseProcess
from loops.interfaces import IConcept from loops.interfaces import IConcept
from loops.type import TypeInterfaceSourceList, AdapterBase from loops.type import TypeInterfaceSourceList, AdapterBase
# register type interfaces - (TODO: use a function for this) # register type interfaces - (TODO: use a function for this)
TypeInterfaceSourceList.typeInterfaces += (IProcessDefinition,) TypeInterfaceSourceList.typeInterfaces += (IProcess,)
class ProcessAdapterMixin(object): class ProcessAdapterMixin(object):
@ -49,12 +49,12 @@ class ProcessAdapterMixin(object):
@Lazy @Lazy
def successorPred(self): def successorPred(self):
return self.conceptManager['successor'] return self.conceptManager['follows']
class ProcessDefinition(AdapterBase, BaseProcessDefinition, ProcessAdapterMixin): class Process(AdapterBase, BaseProcess, ProcessAdapterMixin):
""" A typeInterface adapter for concepts of type 'process'. """ A typeInterface adapter for concepts of type 'process'.
""" """
implements(IProcessDefinition) implements(IProcess)

View file

@ -25,7 +25,7 @@ $Id$
from zope.component import adapts from zope.component import adapts
from zope.interface import implements, Interface from zope.interface import implements, Interface
from cybertools.process.interfaces import IProcessDefinition from cybertools.process.interfaces import IProcess
from loops.concept import Concept from loops.concept import Concept
from loops.interfaces import ITypeConcept from loops.interfaces import ITypeConcept
from loops.setup import SetupManager as BaseSetupManager from loops.setup import SetupManager as BaseSetupManager
@ -42,9 +42,9 @@ class SetupManager(BaseSetupManager):
conceptType=type) conceptType=type)
processTypeAdapter = ITypeConcept(process) processTypeAdapter = ITypeConcept(process)
if not processTypeAdapter.typeInterface: if not processTypeAdapter.typeInterface:
processTypeAdapter.typeInterface = IProcessDefinition processTypeAdapter.typeInterface = IProcess
# predicates: # predicates:
successor = self.addObject(concepts, Concept, 'successor', title=u'successor', follows = self.addObject(concepts, Concept, 'follows', title=u'follows',
conceptType=predicate) conceptType=predicate)