-
Notifications
You must be signed in to change notification settings - Fork 2
Activity Diagram: Object Flow Documentation
stacks0n edited this page Apr 27, 2014
·
1 revision
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.
# 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