KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > util > WorkflowStateHelper


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.workflow.util;
6
7 import com.opensymphony.workflow.spi.WorkflowEntry;
8
9
10 /**
11  * @author Hani Suleiman (hani@formicary.net)
12  * Date: Aug 29, 2003
13  * Time: 5:14:56 PM
14  */

15 public class WorkflowStateHelper {
16     //~ Methods ////////////////////////////////////////////////////////////////
17

18     public static int[] getPossibleStates(int state) {
19         switch (state) {
20         case WorkflowEntry.CREATED:
21             return new int[] {WorkflowEntry.ACTIVATED};
22
23         case WorkflowEntry.ACTIVATED:
24             return new int[] {WorkflowEntry.SUSPENDED, WorkflowEntry.KILLED};
25
26         case WorkflowEntry.SUSPENDED:
27             return new int[] {WorkflowEntry.ACTIVATED, WorkflowEntry.KILLED};
28
29         default:
30             return new int[0];
31         }
32     }
33 }
34
Popular Tags