001: package org.enhydra.shark.api.client.wfservice;
002:
003: import org.enhydra.shark.api.client.wfmc.wapi.WMActivityInstance;
004: import org.enhydra.shark.api.client.wfmc.wapi.WMActivityInstanceIterator;
005: import org.enhydra.shark.api.client.wfmc.wapi.WMSessionHandle;
006:
007: /**
008: * Extended client side interface enabling user to do various things such as to get
009: * information about future or past activities from XPDL, or firstly or lastly executed
010: * activities within process instance.
011: *
012: * @author Sasa Bojanic
013: * @author Vladimir Puskas
014: */
015: public interface AdminMiscExt {
016:
017: /**
018: * Returns starting activities for the process definition determined by given entity.
019: */
020: WMEntityIterator getStartingActivities(WMSessionHandle shandle,
021: WMEntity procDefEnt) throws Exception;
022:
023: /**
024: * Returns ending activities for the process definition determined by given entity.
025: */
026: WMEntityIterator getEndingActivities(WMSessionHandle shandle,
027: WMEntity procDefEnt) throws Exception;
028:
029: /**
030: * As a result of method getBeginningOptions, user will get an array of OptionInfo
031: * structure. OptionInfo structure holds the information about activity definition, can
032: * hold information about Transition definition from the specified activity to target
033: * one. If user specifies that he wants to obtain transition information, user will get
034: * information necessary to navigate through the process by setting appropriate
035: * variable to a certain value before instantiating the process from definition, but in
036: * that case process definitions must not have AND Splits or Joins, and it is important
037: * that XPDL transition conditions are written by the given rules:
038: * <p>
039: * <ul>
040: * <li> the left side of expression must be XPDL process variable Id, which type is
041: * either BasicType->String, BasicType->Integer, BasicType->Float or BasicType->Boolean
042: * <li> the right side of expression must be expession that can be evaluated using
043: * interpreter specified for this XPDL (JavaScript or Java), and must result in String,
044: * Long, Long, Double or Boolean (depending on variable on the left side).
045: * </ul>
046: * Here are the examples of valid expressions assuming that whereToGo is String and
047: * navig is Integer variable:
048: * <p>
049: * <ul>
050: * <li> whereToGo.equals("A1")
051: * <li> navig==32
052: * </ul>
053: * <p>
054: * Also, in the case when user wants to obtain transition information, and if there are
055: * more transitions following from specified activity, each transition (except
056: * OTHERWISE transition and the transition going to Route activity) MUST have condition
057: * expression defined. There are several other rules regarding Route and Block
058: * activities in this case:
059: * <p>
060: * <ul>
061: * <li>If the Route activity is the next one, methods return info about activity(ies)
062: * and correspondig transition(s) going from Route activity.
063: * <li>Transition to Route activity must be either OTHERWISE, or the only one and
064: * unconditional
065: * </ul>
066: */
067: OptionInfo[] getBeginningOptions(WMSessionHandle shandle,
068: WMEntity procDefEnt, boolean provideTransitionInformation)
069: throws Exception;
070:
071: /**
072: * As a result of method getNextOptions, user will get an array of OptionInfo
073: * structure. OptionInfo structure holds the information about activity definition and
074: * information about Transition definition from the specified activity to target one.
075: * If user specifies that he wants to obtain transition information, which can be used
076: * to navigate through the process by setting appropriate variable to a certain value,
077: * process definitions must not have AND Splits or Joins, and it is important that XPDL
078: * transition conditions are written by the given rules:
079: * <p>
080: * <ul>
081: * <li> the left side of expression must be XPDL process variable Id, which type is
082: * either BasicType->String, BasicType->Integer, BasicType->Float or BasicType->Boolean
083: * <li> the right side of expression must be expession that can be evaluated using
084: * interpreter specified for this XPDL (JavaScript or Java), and must result in String,
085: * Long, Long, Double or Boolean (depending on variable on the left side).
086: * </ul>
087: * Here are the examples of valid expressions assuming that whereToGo is String and
088: * navig is Integer variable:
089: * <p>
090: * <ul>
091: * <li> whereToGo.equals("A1")
092: * <li> navig==32
093: * </ul>
094: * <p>
095: * Also, in the case when user wants to obtain transition information, and if there are
096: * more transitions following from specified activity, each transition (except
097: * OTHERWISE transition and the transition going to Route activity) MUST have condition
098: * expression defined. There are several other rules regarding Route and Block
099: * activities in this case:
100: * <p>
101: * <ul>
102: * <li>If the Route activity is the next one, methods return info about activity(ies)
103: * and correspondig transition(s) going from Route activity.
104: * <li>If the activity for which we are searching is the last one within the Block,
105: * this method returns info about the activity following the corresponding Block
106: * activity that encompasses this activity. (NOTE: it does not support nested block
107: * activities).
108: * <li>Transition to Route activity must be either OTHERWISE, or the only one and
109: * unconditional
110: * </ul>
111: */
112: OptionInfo[] getNextOptions(WMSessionHandle shandle,
113: WMEntity actDefEnt, boolean provideTransitionInformation,
114: boolean skipAsyncSubflow) throws Exception;
115:
116: /**
117: * As a result of method getPreviousOptions, user will get an array of OptionInfo
118: * structure. OptionInfo structure holds the information about activity definition and
119: * information about Transition definition from the specified activity to previous one.
120: * There are several other rules regarding Route and Block activities in this case:
121: * <p>
122: * <ul>
123: * <li>If the Route activity is the previous one, method returns info about
124: * activity(ies) and correspondig transition(s) preceding the Route activity.
125: * <li>If parameter 'findOnlyManual' is set to true, and if activity different than
126: * 'No' is the previous one, method returns info about activity(ies) and correspondig
127: * transition(s) preceding this activity.
128: * <li>If the activity for which we are searching is the first one within the Block,
129: * this method returns info about the activity preceding the corresponding Block
130: * activity that encompasses this activity. (NOTE: it does not support nested block
131: * activities).
132: * </ul>
133: */
134: OptionInfo[] getPreviousOptions(WMSessionHandle shandle,
135: WMEntity actDefEnt, boolean findOnlyManual)
136: throws Exception;
137:
138: /**
139: * Returns maximally 'limit' number of (sorted by the time finished) first-finished
140: * 'Manual' activity instances from specified process or, if insideSameProcess
141: * parameter is false, some of its synchronous sub-processes.
142: */
143: WMActivityInstanceIterator getFirstFinished(
144: WMSessionHandle shandle, String procId, int limit,
145: boolean insideSameProcess) throws Exception;
146:
147: /**
148: * Returns maximally 'limit' number of (sorted by the time finished) last-finished
149: * 'Manual' activity instances from specified process or, if insideSameProcess
150: * parameter is false, some of its synchronous sub-processes.
151: */
152: WMActivityInstanceIterator getLastFinished(WMSessionHandle shandle,
153: String procId, int limit, boolean insideSameProcess)
154: throws Exception;
155:
156: /**
157: * Returns the 'Manual' activity completed prior to the given running activity from the
158: * given running process instance. If specified so (by setting 'insideSameProcess'
159: * parameter to 'false'), the returned activity can be retrieved from another process
160: * which can be either sub-process of the specified process, or the process that
161: * instantiated specified process as its sub-flow.
162: */
163: WMActivityInstance getPrevious(WMSessionHandle shandle,
164: String procId, String actId, boolean insideSameProcess)
165: throws Exception;
166:
167: /**
168: * This method returns the information about activities waiting to execute for the
169: * given procesId. This activity state is either 'open.not_running.not_started' or
170: * 'open.running'. If process has sub-flow which state is 'open.running', it will
171: * search the sub-process to find its running activities. If there is a block activity
172: * in 'open.running' state, it won't be reported itself - only running activities
173: * inside block will be reported. If 'onlyManual' is ste to true, only purely 'Manual'
174: * activities will be returned.
175: * <p>
176: */
177: WMActivityInstanceIterator getRunningActivities(
178: WMSessionHandle shandle, String procId, boolean onlyManual)
179: throws Exception;
180:
181: }
|