Skip to content

Activity Diagram: Object Flow Documentation

stacks0n edited this page Apr 27, 2014 · 1 revision

UML diagram

screen shot 2014-04-27 at 10 30 23 am

Papyrus Nodes and Edges used

screen shot 2014-04-27 at 10 34 18 amscreen shot 2014-04-27 at 10 33 48 amscreen shot 2014-04-27 at 10 33 58 amscreen shot 2014-04-27 at 10 34 08 am

Instructions

Functions can be written with Opaque Actions that define code bodies. For assigning and chaining local variables to the inputs/outputs of an Opaque Action, Object Flows should link Input and Output pins between Opaque Actions. The 'Name' field of the Object Flow will define the local variable name in the generated Ruby code. When writing a code body, function parameters and return values should reference the 'Name' given to the Input and Output Pins attached to the Opaque Action. screen shot 2014-04-27 at 10 37 56 am screen shot 2014-04-27 at 10 38 18 am

Sample Ruby output

# The activity "RandomVariableAssignment" has 7 nodes and 1 control flows 

def get_rand
  n = 0
  n = rand(5)
  n
end

def summation(n)
  sum = 0
  (0..n).each do |i|
    sum += i
  end
  sum
end

def RandomVariableAssignment
  i = get_rand()
  sum = summation(i)
end

Quick links