01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.sdlctools.domains.enterprisemodel.impl;
16:
17: import com.metaboss.enterprise.bo.BOException;
18: import com.metaboss.sdlctools.domains.enterprisemodel.BOEntity;
19: import com.metaboss.sdlctools.domains.enterprisemodel.BOState;
20: import com.metaboss.sdlctools.domains.enterprisemodel.BOStateTransitionList;
21: import com.metaboss.sdlctools.domains.enterprisemodel.storage.STState;
22: import com.oldboss.framework.bo.impl.BOObjectImpl;
23:
24: public class BOStateImpl extends BOObjectImpl implements BOState {
25: protected BOMetaBossDomainImpl mMetaBossDomainImpl = null;
26: private BOEntity mOwnerEntity = null;
27: protected STState mDetails = null;
28:
29: /* Instance creator */
30: public static BOState createInstanceForExisting(
31: BOMetaBossDomainImpl pMetaBossDomainImpl,
32: BOEntity pOwnerEntity, STState pDetails) throws BOException {
33: if (pDetails == null)
34: throw new BOException("Empty details structure");
35: BOStateImpl lImpl = new BOStateImpl();
36: lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
37: lImpl.mOwnerEntity = pOwnerEntity;
38: lImpl.mDetails = pDetails;
39: lImpl.setupForExisting();
40: return lImpl;
41: }
42:
43: /* Retrieves element's name. Name is only unique within parent entity */
44: public String getName() throws BOException {
45: return mDetails.Name;
46: }
47:
48: /* Returns element's description */
49: public String getDescription() throws BOException {
50: return mDetails.Description;
51: }
52:
53: /* Returns entity which owns this attribute */
54: public BOEntity getEntity() throws BOException {
55: return mOwnerEntity;
56: }
57:
58: /* Returns stereotype for this attribute */
59: public com.metaboss.sdlctools.types.enterprisemodel.StateType getType()
60: throws BOException {
61: return mDetails.Type;
62: }
63:
64: /* Returns list of transtions it is possible to do from this state.
65: * Note that final states do not have transitions */
66: public BOStateTransitionList getTransitions() throws BOException {
67: return BOStateTransitionListImpl.createInstanceForExisting(
68: mMetaBossDomainImpl, mOwnerEntity, this);
69: }
70: }
|