1 package org.andromda.cartridges.jbpm.metafacades;
2
3 import org.andromda.metafacades.uml.ActivityGraphFacade;
4 import org.andromda.metafacades.uml.StateMachineFacade;
5 import org.andromda.utils.StringUtilsHelper;
6
7
8
9
10
11
12
13 public class JBpmStateVertexLogicImpl
14 extends JBpmStateVertexLogic
15 {
16 private static final long serialVersionUID = 34L;
17
18
19
20
21 public JBpmStateVertexLogicImpl (Object metaObject, String context)
22 {
23 super (metaObject, context);
24 }
25
26
27
28
29
30 protected boolean handleIsContainedInBusinessProcess()
31 {
32 return this.getStateMachine()!= null
33 && this.getStateMachine() instanceof ActivityGraphFacade
34 && ((ActivityGraphFacade)this.getStateMachine()).getUseCase() instanceof JBpmProcessDefinition;
35 }
36
37
38
39
40
41 protected String handleGetNodeClassName()
42 {
43 return StringUtilsHelper.upperCamelCaseName(this.getName()) + "Node";
44 }
45
46
47
48
49
50 protected String handleGetNodePackageName()
51 {
52 return (this.getProcessDefinition() == null) ? null : this.getProcessDefinition().getPackageName();
53 }
54
55
56
57
58 protected Object handleGetProcessDefinition()
59 {
60 Object processDefinition = null;
61
62 final StateMachineFacade stateMachine = this.getStateMachine();
63 if (stateMachine instanceof ActivityGraphFacade)
64 {
65 processDefinition = ((ActivityGraphFacade)stateMachine).getUseCase();
66 }
67
68 return (processDefinition instanceof JBpmProcessDefinition) ? processDefinition : null;
69 }
70 }