/procedures/meta/comments

Module to parse a route whose source step is a decision step.

 2 module PARSE_DECISION_STEP

Method to parse a route whose source step is a decision step.

 5   def parse_route_from_decision_step( route_id )

Design note: The method used for validating the number of input and output routes for each step type.

If the decision step does not have one inbound route ...

 9     if step_inbound_routes( route_source_step_id( route_id ) ).size != 1

... log the step as has having an unexpected number of inbound routes.

 12       logger.error "Decision step with name #{route_source_step_name( route_id )} has #{step_inbound_routes( route_source_step_id( route_id ) ).size} inbound routes."

Otherwise, the decision step does have one inbound route ...

 15     else

... we get the ID of the first - and in this case only - inbound route.

 18       inbound_route_id = step_first_inbound_route( route_source_step_id( route_id ) )

If the inbound route to the source step has been parsed ....

 21       if route_parsed_attribute( inbound_route_id ) == true

... we update the route parsed attribute to true.

 24         update_route_hash( route_id, nil, nil, true, nil, nil )

We refer to the decision step truth table ...

... and if the status of the inbound route to the source step is 'TRUE' ...

 29         if route_status_attribute( inbound_route_id ) == 'TRUE'

... we set the status of this route to 'ALLOWS' ...

 32   				update_route_hash( route_id, nil, 'ALLOWS', nil, nil, nil )

... otherwise, the status of the inbound route to the source step not being ‘TRUE’ ...

 35         else

... we set the status of this route to the status of the inbound route.

 38           update_route_hash( route_id, nil, route_status_attribute( inbound_route_id ), nil, nil, nil )
 39         end

Otherwise, the inbound route is not parsed and will be parsed on a later pass.

 42       end
 43     end
 44   end
 45 end