SHARE
TWEET

Untitled

a guest Jun 19th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [comment encoding = UTF-8 /]
  2. [module aktywnosci('http://www.eclipse.org/uml2/5.0.0/UML',
  3.  'http://www.eclipse.org/uml2/5.0.0/UML/Profile/Standard')]
  4.  
  5.  
  6. [template public putBody (bs : Set(Behavior)) ]
  7.     [for (b : Behavior | bs)]
  8. [if (oclIsKindOf(OpaqueBehavior))][b.oclAsType(OpaqueBehavior).putBehavior('java')/][else][putBehavior(b)/][/if]
  9. [comment][if (oclIsKindOf(OpaqueBehavior))][b.oclAsType(OpaqueBehavior).putBehavior('c++')/][else][putBehavior(b)/][/if][/comment]
  10.     [/for]
  11. [/template]
  12.  
  13. [template public putBody (b : Behavior) ]
  14. [if (oclIsKindOf(OpaqueBehavior))][b.oclAsType(OpaqueBehavior).putBehavior('java')/][else][putBehavior(b)/][/if]
  15. [comment][if (oclIsKindOf(OpaqueBehavior))][b.oclAsType(OpaqueBehavior).putBehavior('c++')/][else][putBehavior(b)/][/if][/comment]
  16. [/template]
  17.  
  18. [template public putBehavior(e : Behavior) ]
  19.     [comment TODO Auto-generated template stub/]
  20. [/template]
  21.  
  22. [template public putBehavior(e : StateMachine) ]
  23.     [comment TODO Auto-generated template stub/]
  24. [/template]
  25.  
  26. [template public putBehavior(e : OpaqueBehavior, lang : String)? ((not language->indexOf(lang)->oclIsInvalid()) and language->indexOf(lang) > 0)]
  27.     [e._body->at(e.language->indexOf(lang))/]
  28. [/template]
  29.  
  30. [template public putBehavior(e : Activity)]
  31. [let var : Set(InitialNode) = e.ownedNode->filter(InitialNode)]
  32.     [for (b : InitialNode | var)]
  33. [b.putActNod()/]
  34.     [/for]
  35. [/let]
  36. [/template]
  37.  
  38. [template public putActNod(n : InitialNode)]
  39. [n.outgoing.target.putActNod()/]
  40. [/template]
  41.  
  42. [template public putActNod(n : ActivityNode)]
  43. // Generic activity node! - [n.name/] [n.eClass().name/]
  44. [n.oclAsType(OpaqueAction)._body->at(1)/]
  45. [for (outg : ActivityEdge | n.outgoing)]
  46. [let GExp : OpaqueExpression = outg.guard]
  47. [if (GExp._body->size()>0 and GExp._body->at(1).size()>0)]
  48. if ([GExp._body->at(1)/]) {
  49.     [outg.target.putActNod()/]
  50. }
  51. [/if]
  52. [/let]
  53. [/for]
  54.  
  55. [/template]
  56.  
  57. [template public putActNod(n : DecisionNode)]
  58. //if Decision node - [n.name/]
  59. [for (outg : ActivityEdge | n.outgoing)]
  60. [let GExp : OpaqueExpression = outg.guard]
  61. [if (i>1)] else [/if]if ([n.getDI()/][GExp._body->at(1)/]){
  62.     [outg.target.putActNod()/]
  63. [/let]
  64. [/for]
  65. [/template]
  66.  
  67. [template public putActNod(n : ActivityFinalNode)]
  68. //finish
  69. [/template]
  70.  
  71. [template public putActNod(n : OpaqueAction)]
  72. // OpaqueAction - [n.name/]
  73. [n._body->at(1)/]
  74. [if (n.outgoing -> size() > 1)]
  75. //Error: [n.outgoing->size()/] outgoing arcs from OpaqueAction [n.name/]
  76. // only one is taken
  77. [/if]
  78. [n.outgoing -> any(true).target.putActNod()/]
  79. [/template]
  80.  
  81. [template putActNod(n : MergeNode)]
  82. [/template]
  83.  
  84. [template public getDI (aDecisionNode : DecisionNode)? (aDecisionNode.decisionInput.oclIsUndefined()._not()) post (trim())]
  85. [aDecisionNode.decisionInput.putBody()/]
  86. [/template]
  87.  
  88. [template public getDI (aDecisionNode : DecisionNode)? (aDecisionNode.decisionInputFlow.oclIsUndefined()._not())]
  89. [aDecisionNode.decisionInputFlow.source.name/]
  90. [/template]
  91.  
  92. [template public putBehavior(e : InteractionOperand) ]
  93.     [e.fragment/]
  94. [/template]
RAW Paste Data
Top