01: /*
02: * Copyright (c) 2002-2003 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.workflow.util;
06:
07: import com.opensymphony.workflow.spi.WorkflowEntry;
08:
09: /**
10: * @author Hani Suleiman (hani@formicary.net)
11: * Date: Aug 29, 2003
12: * Time: 5:14:56 PM
13: */
14: public class WorkflowStateHelper {
15: //~ Methods ////////////////////////////////////////////////////////////////
16:
17: public static int[] getPossibleStates(int state) {
18: switch (state) {
19: case WorkflowEntry.CREATED:
20: return new int[] { WorkflowEntry.ACTIVATED };
21:
22: case WorkflowEntry.ACTIVATED:
23: return new int[] { WorkflowEntry.SUSPENDED,
24: WorkflowEntry.KILLED };
25:
26: case WorkflowEntry.SUSPENDED:
27: return new int[] { WorkflowEntry.ACTIVATED,
28: WorkflowEntry.KILLED };
29:
30: default:
31: return new int[0];
32: }
33: }
34: }
|