/procedures/meta/comments

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

 2 module PARSE_NOT_STEP

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

 5   def parse_route_from_not_step( route_id )

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

If the NOT 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 "NOT step with name #{route_source_step_name( route_id )} has #{step_inbound_routes( route_source_step_id( route_id ) ).size} inbound routes."

Otherwise, the NOT 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 NOT step truth table ...

... and we check the status of the inbound route to the source step.

 29         case route_status_attribute( inbound_route_id )

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

 32         when 'TRUE'

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

 35           update_route_hash( route_id, nil, 'FALSE', nil, nil, nil )

When the status of the inbound route to the source step is 'FALSE' ...

 38         when 'FALSE'

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

 41           update_route_hash( route_id, nil, 'TRUE', nil, nil, nil )

Otherwise, the status of the inbound route being neither ‘TRUE’ nor ‘FALSE’ ...

 44         else

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

 47           update_route_hash( route_id, nil, route_status_attribute( inbound_route_id ), nil, nil, nil )
 48         end

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

 51       end
 52     end
 53   end
 54 end