KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > workflow > SynchronizedWorkflowInstances


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 /* $Id: SynchronizedWorkflowInstances.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.workflow;
21
22
23 /**
24  * <p>
25  * Synchronized workflow instances.
26  * </p>
27  *
28  * <p>
29  * A set of workflow instances with the same workflow schema can be synchronized.
30  * If a transition in this schema is marked as synchronized, it can only be invoked
31  * on all instances in the set at the same time.
32  * </p>
33  *
34  * <p>
35  * When a workflow event is invoked on a set of synchronized workflow instances,
36  * the transition is invoked only if
37  * </p>
38  * <ul>
39  * <li>all instances are in the source state of the transition, and</li>
40  * <li>all conditions of the transition are complied for all instances.</li>
41  * </ul>
42  *
43  * <p>
44  * Then the transition is invoked for all instances in the set.
45  * </p>
46  * <p>
47  * A common usecase of this concept is the simultaneous publishing of
48  * a set of documents (all language versions of a document, a section, ...).
49  * </p>
50  */

51 public interface SynchronizedWorkflowInstances {
52     
53     /**
54      * Returns all executable events.
55      * @see org.apache.lenya.workflow.WorkflowInstance#getExecutableEvents(org.apache.lenya.workflow.Situation)
56      */

57     Event[] getExecutableEvents(Situation situation) throws WorkflowException;
58     
59     /**
60      * Invokes an event on all documents.
61      * @see org.apache.lenya.workflow.WorkflowInstance#invoke(org.apache.lenya.workflow.Situation, org.apache.lenya.workflow.Event)
62      */

63     void invoke(Situation situation, Event event) throws WorkflowException;
64 }
Popular Tags