Skip to content

Activity: Decision & Merge Nodes Documentation

stacks0n edited this page Apr 27, 2014 · 3 revisions

Example UML diagram

screen shot 2014-04-09 at 11 36 17 pm

Papyrus Components

Conditionals can be programmed into the auto-generated Ruby code by setting the Guard on ControlFlow objects. Currently, this support is somewhat limited, and the resulting code includes the clauses, as a comment in the code. screen shot 2014-04-09 at 11 31 18 pm

Order cannot be preserved when generating the resulting output, however any 'else' clause will be listed last. To specify 'else' conditions, the 'Name' field of the control guard should be set to 'else'. The 'Value' does not matter. screen shot 2014-04-09 at 11 31 49 pm

Papyrus Nodes and Edges used

screen shot 2014-04-09 at 11 33 25 pm screen shot 2014-04-09 at 11 33 58 pm screen shot 2014-04-09 at 11 34 27 pm

Sample Ruby output

  #The activity "ControlGuards" has 7 nodes and 8 control flows

def Priority_Order
  #TODO fill in function
end

def Standard_Order
  #TODO fill in function
end

def Rush_Order
  #TODO fill in function
end

def ControlGuards
  #if order == priority
  Priority_Order()
  #if order == rush
  Rush_Order()
  #else
  Standard_Order()
end