KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > corba > WfProcessIteratorCORBA


1 package org.enhydra.shark.corba;
2
3 import org.omg.WfBase.*;
4 import org.omg.WorkflowModel.WfProcess;
5 import org.omg.WorkflowModel._WfProcessIteratorImplBase;
6
7 /**
8  * Iterator for process managers processes.
9  *
10  * @author Sasa Bojanic
11  * @version 1.0
12  */

13 public class WfProcessIteratorCORBA extends _WfProcessIteratorImplBase {
14
15    org.enhydra.shark.api.client.wfmodel.WfProcessIterator myIterator;
16
17    private Collective __collective;
18
19    protected WfProcessIteratorCORBA(Collective toJoin,
20                                     org.enhydra.shark.api.client.wfmodel.WfProcessIterator iter) throws BaseException {
21       __collective = toJoin;
22       toJoin.__recruit(this);
23       this.myIterator = iter;
24    }
25
26    public String JavaDoc query_expression() throws BaseException {
27       try {
28          return myIterator.query_expression();
29       } catch (Exception JavaDoc ex) {
30          throw new BaseException();
31       }
32    }
33
34    /**
35     * The following names may be used in queries: processDefinitionId,
36     * key, name, priority, description, state. Also the names of process
37     * context variables can be used, but the "context_" prefix should be
38     * placed before variable Id, i.e. "context_myvariable".
39     */

40    public void set_query_expression(String JavaDoc query) throws BaseException,
41                                                  InvalidQuery {
42       try {
43          myIterator.set_query_expression(query);
44       } catch (org.enhydra.shark.api.client.wfbase.InvalidQuery iq) {
45          throw new InvalidQuery();
46       } catch (Exception JavaDoc ex) {
47          throw new BaseException();
48       }
49    }
50
51    public NameValue[] names_in_expression() throws BaseException {
52       try {
53          return SharkCORBAUtilities.makeCORBANameValueArray(this._orb(),
54                                                             myIterator.names_in_expression());
55       } catch (Exception JavaDoc ex) {
56          throw new BaseException();
57       }
58    }
59
60    public void set_names_in_expression(NameValue[] query) throws BaseException,
61                                                          NameMismatch {
62       try {
63          myIterator.set_names_in_expression(SharkCORBAUtilities.makeMap(query));
64       } catch (org.enhydra.shark.api.client.wfbase.NameMismatch nm) {
65          throw new NameMismatch();
66       } catch (Exception JavaDoc ex) {
67          throw new BaseException();
68       }
69    }
70
71    public String JavaDoc query_grammar() throws BaseException {
72       try {
73          return myIterator.query_grammar();
74       } catch (Exception JavaDoc ex) {
75          throw new BaseException();
76       }
77    }
78
79    public void set_query_grammar(String JavaDoc query_grammmar) throws BaseException,
80                                                        GrammarNotSupported {
81       try {
82          myIterator.set_query_grammar(query_grammmar);
83       } catch (org.enhydra.shark.api.client.wfbase.GrammarNotSupported gns) {
84          throw new GrammarNotSupported();
85       } catch (Exception JavaDoc ex) {
86          throw new BaseException();
87       }
88    }
89
90    public int how_many() throws BaseException {
91       try {
92          return myIterator.how_many();
93       } catch (Exception JavaDoc ex) {
94          throw new BaseException();
95       }
96    }
97
98    public void goto_start() throws BaseException {
99       try {
100          myIterator.goto_start();
101       } catch (Exception JavaDoc ex) {
102          throw new BaseException();
103       }
104    }
105
106    public void goto_end() throws BaseException {
107       try {
108          myIterator.goto_end();
109       } catch (Exception JavaDoc ex) {
110          throw new BaseException();
111       }
112    }
113
114    public WfProcess get_next_object() throws BaseException {
115       try {
116          return new WfProcessCORBA(__collective, myIterator.get_next_object());
117       } catch (Exception JavaDoc ex) {
118          throw new BaseException();
119       }
120    }
121
122    public WfProcess get_previous_object() throws BaseException {
123       try {
124          return new WfProcessCORBA(__collective,
125                                    myIterator.get_previous_object());
126       } catch (Exception JavaDoc ex) {
127          throw new BaseException();
128       }
129    }
130
131    public WfProcess[] get_next_n_sequence(int max_number) throws BaseException {
132       try {
133          return SharkCORBAUtilities.makeCORBAProcesses(__collective,
134                                                        myIterator.get_next_n_sequence(max_number));
135       } catch (Exception JavaDoc ex) {
136          throw new BaseException();
137       }
138    }
139
140    public WfProcess[] get_previous_n_sequence(int max_number) throws BaseException {
141       try {
142          return SharkCORBAUtilities.makeCORBAProcesses(__collective,
143                                                        myIterator.get_previous_n_sequence(max_number));
144       } catch (Exception JavaDoc ex) {
145          throw new BaseException();
146       }
147    }
148
149 }
Popular Tags