01: package org.andromda.cartridges.jbpm.metafacades;
02:
03: import org.andromda.utils.StringUtilsHelper;
04: import org.andromda.metafacades.uml.StateMachineFacade;
05: import org.andromda.metafacades.uml.ActivityGraphFacade;
06:
07: /**
08: * MetafacadeLogic implementation for org.andromda.cartridges.jbpm.metafacades.JBpmStateVertex.
09: *
10: * @see org.andromda.cartridges.jbpm.metafacades.JBpmStateVertex
11: */
12: public class JBpmStateVertexLogicImpl extends JBpmStateVertexLogic {
13:
14: public JBpmStateVertexLogicImpl(Object metaObject, String context) {
15: super (metaObject, context);
16: }
17:
18: /**
19: * @see org.andromda.cartridges.jbpm.metafacades.JBpmStateVertex#isContainedInBusinessProcess()
20: */
21: protected boolean handleIsContainedInBusinessProcess() {
22: return this .getStateMachine() instanceof ActivityGraphFacade
23: && ((ActivityGraphFacade) this .getStateMachine())
24: .getUseCase() instanceof JBpmProcessDefinition;
25: }
26:
27: /**
28: * @see org.andromda.cartridges.jbpm.metafacades.JBpmStateVertex#getNodeClassName()
29: */
30: protected java.lang.String handleGetNodeClassName() {
31: return StringUtilsHelper.upperCamelCaseName(this .getName())
32: + "Node";
33: }
34:
35: /**
36: * @see org.andromda.cartridges.jbpm.metafacades.JBpmStateVertex#getNodePackageName()
37: */
38: protected java.lang.String handleGetNodePackageName() {
39: return (this .getProcessDefinition() == null) ? null : this
40: .getProcessDefinition().getPackageName();
41: }
42:
43: protected Object handleGetProcessDefinition() {
44: Object processDefinition = null;
45:
46: final StateMachineFacade stateMachine = this .getStateMachine();
47: if (stateMachine instanceof ActivityGraphFacade) {
48: processDefinition = ((ActivityGraphFacade) stateMachine)
49: .getUseCase();
50: }
51:
52: return (processDefinition instanceof JBpmProcessDefinition) ? processDefinition
53: : null;
54: }
55: }
|