Professional Documents
Culture Documents
BusinessProcess
•name
•folders
•initAgent
•startActivity
•stateOfWF AgentSpec
•name
Folder
Order •bp
WF_Type Activity •folder •data
•name Worklist •activity
•relevantAgents •orders
•actualAgents
Agent InternalAppClass
•worklist •className
•methodSignature
HumanAgent AutoAgent
•userID
•passwd
ExternalApp InternalAppObject
•startingCommand •objectID
Considering rules in the context of the class hierarchy may be (de-)activated at different levels of granularity
of an object-oriented database schema they may be ranging from object level to class level (cf. keywords
attached to a specific class or defined apart from any class. ACTIVATED and DEACTIVATED in Figure 4). Class
According to this distinction TriGS supports two catego- level granularity implies (de-)activating a rule for all
ries of rules, called local rules and global rules. A local instances within its scope. Object level granularity allows
rule allows to monitor specific behavior of certain classes. (de-)activating a rule for specific instances thus supporting
Thus the event selector of a local rule consists of a trigger- a powerful exception handling mechanism.
ing class in addition to a triggering method. The triggering
class denotes the class which the rule is attached to. The
triggering method denotes, in terms of GemStone, a class 3.2 Incorporating rules into the object-oriented
method or an instance method (default) which raises the workflow model
event before or after its execution (cf. keywords
CLASS_METHOD/INSTANCE_METHOD and PRE/POST In our workflow model TriGSflow ECA rules are
in Figure 4). Since a local rule is attached to a specific applied in three different areas, which are illustrated in
class it is subject to inheritance. This implies that a local Figure 5, namely activity ordering, agent selection, and
rule is triggered not only by invoking the triggering worklist management. The different kinds of rules are
method on any object of the triggering class but also by orthogonal to each other. In the following we discuss the
invoking this method on any object of its subclasses. Fur- use of ECA rules for TriGSflow in detail. All examples
thermore, TriGS allows to override inherited rules in sub- given are taken from a simple reordering system. Part of
classes [Kapp94a]. the activity net of the reordering system is depicted in Fig-
In contrast to a local rule, a global rule allows to moni- ure 6. The workflow is started every time the need to reor-
tor specific behavior of arbitrary classes. Thus the event der a certain item is indicated. In most examples, the
selector of a global rule consists of a triggering method coupling modes between event and condition as well as
only. Consequently, a global rule monitors all classes between condition and action are immediate according to
which know the triggering method. Since a global rule is the notion in [Kapp94b] resulting in identical event selec-
attached to a specific method only, it is neither subject to tors. To increase readability condition event selectors and/
inheritance nor overriding. Both local and global rules or action event selectors are omitted in those cases.
ECA rules for Worklist Management
Worklist Agent Worklist Agent Worklist Agent Worklist Agent Worklist Agent Worklist Agent
Activity 3 Activity 5
∧ ∧
Activity 1 Activity 2 Activity 7
Activity ordering: The relationships between activities, would be executed. Exception handling will not be treated
i.e., the activity net, can be realized by using ECA rules, further in this paper. The action of an activity ordering rule
thus specifying a certain workflow type. Concerning the has to notify the agent responsible for performing the suc-
mapping of relationships to rules we can identify six cases ceeding activity. The method notifyAgent puts a cor-
according to the basic control structures: responding order for the successor activity into the
• a relationship representing a sequence is mapped to a worklist of the agent chosen to perform this activity (for
single rule selecting agents see next section). The method perform
starts the execution of the activity no matter whether a
• each relationship taking part in an OR-Alternative human agent or an automatic agent is engaged. In case of a
(exclusive OR or inclusive OR) is mapped to a single human agent it waits until the human agent signals the end
rule of the execution. Every rule responsible for activity order-
• all relationships taking part in a concurrent fork are ing contains the methods perform and notifyAgent
mapped to a single rule in its event part and action part, respectively.
• each relationship taking part in an exOR-Join is Consider the activity net in Figure 6. Furthermore, con-
mapped to a single rule sider the following rules realizing an exOR-Alternative
between executing the activity “get offers“ and executing
• all relationships taking part in an inOR-Join are
no activity at all, and equivalently realizing an exOR-Join
mapped to one or more rules depending on the desired
between the activity “get offers“ and no activity. This par-
semantics
ticular situation of exOR-joining with “no activity” is han-
• all relationships taking part in an AND-Join are dled in such a way that the activity “create order form”
mapped to a single rule triggers either “get offers” or “select supplier”.
The event of an activity ordering rule always consti-
tutes the end of the preceding activity or - in case of an
get
AND-Join or of an inOR-Join - of all participating preced- offers
ing activities, respectively. The condition checks whether
x x ...
the succeeding activity has to be performed or not. This is
done by evaluating queries against the actual folder and/or create select send
order form supplier order
other data concerning the actual workflow, e.g., if a certain
date is expired the activity is not performed. In case of an Figure 6. Part of an Activity Net
inOR-Alternative the result sets of the conditions may The first two rules named R_GetOffers and
overlap, whereas an exOR-Alternative is reflected by R_SelectSupplier1 are activated for the same
mutual exclusive conditions. Note, that an exception han- instance of class Activity, namely
dling mechanism [Aura89] has to handle the case that all a_create_order_form. That is, after the method
conditions evaluate to false, i.e., no succeeding activity perform has been executed on that instance (denoted by
the keyword POST), both rules are triggered. The condi- where the method has been originally defined and all
tion of the rule named R_GetOffers checks if offers are direct or indirect subclasses of those classes.
needed that are missing or that are no longer up-to-date. If (2) Explicit definition of relevant agents: At definition
the condition evaluates to true the action is executed by time it is useful to reduce the set of possible agents to
sending the message notifyAgent to the instance agents which are relevant for the particular workflow
a_get_offers of class Activity representing one of type, thus incorporating more semantics into the
the mutual exclusive successors of the activity model. This can be done by collecting the set of rele-
a_create_order_form within the activity net (cf. vant agents as instances of class InternalApp-
Figure 6). class (cf. Figure 1). The relevant agents of a specific
DEFINE RULE R_GetOffers activity are referenced via its instance variable rel-
ON POST (Activity, perform) DO evantAgents.
IF Offers notUpToDateFor: ((rule_trgO (3) Selection of actual agents: For a specific workflow the
getFolder at:’Order’)
set of relevant agents may be again reduced to a set of
positions) THEN
actual agents on the basis of actual data by using ECA
EXECUTE a_get_offers notifyAgent
rules. In contrast to the first two steps where agent
ACTIVATED FOR (a_create_order_form).
selection is done at class level, the selection of actual
The condition of the rule named agents is done at instance level. Applying rules for
R_SelectSupplier1 is complementary to the condi- actual agent selection provides the possibility to react
tion of R_GetOffers. If it evaluates to true no more immediately to state changes of some relevant agent,
offers are required and therefore the supplier can be e.g., a machine breakdown. Furthermore, it is possible
selected immediately by sending the message notify- to implement different selection policies and to switch
Agent to the instance a_select_supplier of class between them dynamically by simply activating and
Activity representing the other successor of the activ- deactivating the corresponding rule at activity instance
ity a_create_order_form. level. Note, only one specific selection rule can be
DEFINE RULE R_SelectSupplier1 active for a certain activity at one point in time. Con-
ON POST (Activity, perform) DO cerning the integration of internal application classes,
IF Offers areUpToDateFor: ((rule_trgO if an instance of an internal application class is
getFolder at: ’Order’) selected as actual agent a corresponding instance of
positions) THEN class InternalAppObject is created if it does not
EXECUTE a_select_supplier notifyAgent already exist.
ACTIVATED FOR (a_create_order_form).
The following rule named R_MinWorkload realizes
The third rule named R_SelectSupplier2 is acti- the selection of actual agents on the basis of a minimal
vated for the instance a_get_offers of class Activ- workload policy.
ity. The condition is set to be always true denoting that
DEFINE RULE R_MinWorkload
all offers are available now and that the action which noti-
ON PRE (Activity, notifyAgent) DO
fies the agent(s) responsible for selecting a supplier is exe-
IF (rule_trgO relevantAgents)
cuted in any case.
selMinWorkload THEN
DEFINE RULE R_SelectSupplier2 EXECUTE (rule_trgO actualAgents)
ON POST (Activity, perform) DO removeAll; add: QUERY_RESULT
IF true THEN ACTIVATED FOR (a_select_supplier).
EXECUTE a_select_supplier notifyAgent The event is signaled before the method notify-
ACTIVATED FOR (a_get_offers). Agent of class Activity is executed (denoted by the
keyword PRE). The condition determines the set of actual
Agent selection: The process of selecting one or more agents according to a specific selection policy, e.g., select-
agents performing a certain activity consists of three steps. ing the agent with the lowest workload (selMinWork-
Below, these steps are explained for internal application load). Analogous to the condition of activity ordering
agents. They apply equally for external application agents rules this is done by means of queries against the actual
and human agents. folder and/or other data concerning the actual workflow.
(1) Implicit definition of possible agents: By mapping an The selected agent is passed to the action of the rule (cf.
activity to a certain method of an internal application, keyword QUERY_RESULT). The action of the rule assigns
the set of classes able to respond to the corresponding the query result to the instance variable actualAgents
message is implicitly defined. It comprises all classes of the triggering object.
Worklist management: ECA rules are also applied to petence hierarchy, also called role hierarchy in the work-
coordinate the processing of orders waiting inside the flow literature, has to be incorporated into our agent
worklist of a specific agent. They monitor the worklists of selection strategy. A multi-level transaction model includ-
automatic agents and start processing the next order every ing intra-workflow transactions and inter-workflow trans-
time an automatic agent becomes inactive. This state is actions will be defined to provide for flexible yet stable
indicated after an order is removed from the worklist. The workflow management. TriGSflow has been applied to tra-
following rule named R_StartOnRemove is triggered ditional office automation environments so far. However,
every time the message remove is sent to an instance of if workflow systems want to gain leverage on a broader
class Worklist that belongs to an automatic agent (cf. scope they have to support the whole production process
ACTIVATED FOR clause). The condition checks in addition to administrative processes. The applicability
whether there are remaining orders to be processed. If the of TriGSflow for implementing a production planning and
worklist is not empty, i.e., there are remaining orders, the control system is currently evaluated in a case study. Last
action selects the next order in turn (method nex- but not least, tools for designing workflow applications
tOrder) and sends the message perform to the corre- based on active object-oriented database systems are still
sponding activity. missing. There is a growing awareness of the problem of
designing active object-oriented database applications
DEFINE RULE R_StartOnRemove
ON POST (Worklist, remove) DO
[Bich94], and there are several graphical workflow model-
IF rule_trgO isEmpty isFalse THEN ing tools on the market. However, the integration of these
EXECUTE ((rule_trgO nextOrder) two vivid research areas taking into account the ideosyn-
activity) perform cracies of a high-level design environment for workflow
ACTIVATED FOR (AutoAgent collect: applications incorporating rules has to be further explored.
[:x|x worklist]).
The execution of an order which is inserted into an
Acknowledgement:
empty worklist is triggered by another rule, named
R_StartOnInsert, where the event part is defined on The authors are grateful to P. Lang for his valuable help in
the insertion of that order. Note that condition event selec- implementing the TriGSflow prototype.
tor and action event selector are different. Thus, before the
message insert is sent to an instance of class
Worklist, the rule is triggered and its condition is References
checked immediately. If the actual worklist is empty
before the insert operation takes place the action of this [Aura89] E. Auramäki, M. Leppänen, Exceptions and
rule, which is executed after the insert operation, starts Office Information Systems, Office Information
processing of the next order analogous to rule Systems: The Design Process, B. Pernici and
R_StartOnRemove. A.A. Verrijn-Stuart (eds.), North Holland, 1989
[Daya90] U. Dayal, M. Hsu, R. Ladin, Organizing Long- [Kapp91] G. Kappel. Reorganizing Object Behavior by
Running Activities with Triggers and Transac- Behavior Composition - Coping with Evolving
tions, Proc. of the 1990 ACM SIGMOD Int. Requirements in Office Systems, Datenbanksys-
Conference on Management of Data , Atlantic teme in Büro, Technik und Wissenschaft (BTW),
City, NJ, 1990 H.-J. Appelrath (ed.), Springer, 1991
[DeAn81] V. De Antonellis V., B. Zonta, Modelling Events [Kapp94a] G. Kappel, S. Rausch-Schott, W. Retschitzegger,
in Data Base Applications Design, Proc. VLDB S. Vieweg, TriGS - Making a Passive Object-
1981. Oriented Database System Active, Journal of
Object-Oriented Programming (JOOP), July-
[Desh93] S. Deshpande, Developing Distributed Object- August, 1994
Oriented Applications Using the CORBA, The
Seventh European Conference on Object-Ori- [Kapp94b] G. Kappel, S. Rausch-Schott, W. Retschitzegger,
ented Programming (ECOOP‘93), Tutorial Beyond Coupling Modes - Implementing Active
Notes, Kaiserslautern, July 1993 Concepts on Top of a Commercial ooDBMS, Int.
Symposium on Object-Oriented Methodologies
[Enge94] G. Engels, G. Kappel, Object-Oriented Systems and Systems (ISOOMS), Palermo, September
Development: Will the New Approach Solve Old 1994
Problems?, Proceedings of the IFIP94 World
Congress, Vol.III, K. Duncan and K. Krueger
[McCa93] D. R. McCarthy, S. K. Sarin, Workflow and
(eds.), North-Holland, September 1994 Transactions in InConcert, IEEE Bulletin of the
Technical Committee on Data Engineering, Vol.
[Gatz92] S. Gatziu, K.R. Dittrich, SAMOS: an Active 16, No. 2, June, 1993
Object-Oriented Database System, IEEE Bulle-
[Pete81] J. L. Peterson, Petri net theory and the modelling
tin of the Technical Commitee on Data
of systems, Prentice Hall, 1981
Enginieering, Vol. 15, No. 1-4, December 1992
[Rein93] B. Reinwald, Workflow Management in Distrib-
[Garc94] H. Garcia-Molina, K. Salem, Services for a
uted Systems, Teubner, Stuttgart-Leipzig, 1993
Workflow Management System, IEEE Bulletin of (in german)
the Technical Committee on Data Engineering,
Vol. 17, No. 1, March, 1994 [Sche94] A.-W. Scheer, Wirtschaftsinformatik - Referenz-
modelle für industrielle Geschäftsprozesse, 4.
[Geor93] D. Georgakopoulos, et al., An Extended Transac- Auflage, Springer, 1994 (in german)
tion Environment for Workflows in Distributed
Object Computing, IEEE Bulletin of the Techni- [Shet93] A. Sheth, M. Rusinkiewicz, On Transactional
cal Committee on Data Engineering, Vol. 16, Workflows, IEEE Bulletin of the Technical Com-
No. 2, June, 1993 mittee on Data Engineering, Vol. 16, No. 2,
June, 1993
[Hsu93] M. Hsu, R. Obermarck, R. Vuurboom, Integra-
tion and Interoperability of a Multimedia Work- [Yang89] J. Yang, A Proposal For Incorporating Rules In
flow Model and Execution, IEEE Bulletin of the ODA-Documents, Office Information Systems:
Technical Committee on Data Engineering, Vol. The Design Process, B. Pernici and A.A. Verrijn-
16, No. 2, June, 1993 Stuart (eds.), North Holland, 1989