View Javadoc

1   /*******************************************************************************
2    *  Imixs Workflow 
3    *  Copyright (C) 2001, 2011 Imixs Software Solutions GmbH,  
4    *  http://www.imixs.com
5    *  
6    *  This program is free software; you can redistribute it and/or 
7    *  modify it under the terms of the GNU General Public License 
8    *  as published by the Free Software Foundation; either version 2 
9    *  of the License, or (at your option) any later version.
10   *  
11   *  This program is distributed in the hope that it will be useful, 
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
14   *  General Public License for more details.
15   *  
16   *  You can receive a copy of the GNU General Public
17   *  License at http://www.gnu.org/licenses/gpl.html
18   *  
19   *  Project: 
20   *  	http://www.imixs.org
21   *  	http://java.net/projects/imixs-workflow
22   *  
23   *  Contributors:  
24   *  	Imixs Software Solutions GmbH - initial API and implementation
25   *  	Ralph Soika - Software Developer
26   *******************************************************************************/
27  
28  package org.imixs.workflow.jee.ejb;
29  
30  import java.util.Collection;
31  
32  import javax.ejb.Remote;
33  
34  import org.imixs.workflow.ItemCollection;
35  
36  
37  /**
38   * The WorkflowScheduler remote Interface
39   * This Interface represents a schedueld Workflow Service. 
40   * It is used by the WorkflowSchedulerBean which implements 
41   * a timer service to schedule workflow processing
42   * 
43   * 
44   * @author rsoika
45   *
46   */
47  @Remote
48  public interface WorkflowSchedulerRemote  {
49  
50  	/**
51  	 * schedules a new Workflow Service. The method expects an ItemCollection
52  	 * (timerdescription) with the following informations:
53  	 * 
54  	 * datstart - Date Object datstop - Date Object numInterval - Integer Object
55  	 * (interval in seconds) id - String - unique identifier for the schedule
56  	 * Service. This param should contain the EJB name as only one scheduled
57  	 * Workflow should run inside a single WorkflowInstance.
58  	 * If a timer with the id is already running the method stops this timer object first 
59  	 * and reschedules the timer .
60  	 */
61  	public void scheduleWorkflow(ItemCollection timerdescription)
62  			throws Exception;
63  
64  	/**
65  	 * cancles a running timer instance. After cancel a timer the corresponding
66  	 * timerDescripton (ItemCollection) is no longer valid
67  	 * 
68  	 */
69  	public void cancelScheduleWorkflow(String id) throws Exception;
70  
71  	/**
72  	 * this method returns a Itemcollection with the TimerDescirpiton for the
73  	 * specific timer object.
74  	 * 
75  	 * @param id
76  	 *            identifies the timer object
77  	 * @return ItemCollection containing the TimerDescription
78  	 * @throws Exception
79  	 */
80  	public ItemCollection findTimerDescription(String id) throws Exception;
81  
82  	
83  	/**
84  	 * returns a list of all Timer Descriptions loaded by this Instance.
85  	 * @return
86  	 */
87  	public Collection<ItemCollection> findAllTimerDescriptions() throws Exception;
88  
89  }