/procedures/meta/comments

Module to assign a potential state to a business step.

 2 module PARSE_ASSIGN_POTENTIAL_BUSINESS_STEP_STATE

Method to assign a potential state to a business step, being the target of a successfully parsed route.

 5   def assign_potential_business_step_state( route_id )

If the route we're attempting to parse has been successfully parsed ...

 8     if route_parsed_attribute( route_id ) == true

... we write to the parse log, reporting the route's parsed status.

 11       @parse_log << "Successfully parsed as #{route_status_attribute( route_id )}."

... if the target step of the route we've parsed is a business step ...

 14       if route_target_step_type( route_id ) == 'Business step'

We check the status of the route we've parsed.

 17         case route_status_attribute( route_id )

When the status of the route we've parsed is 'TRUE' ...

 20         when "TRUE"

... we don't want steps that are scheduled to happen to be also listed as steps that are caused to happen, so ...

... unless the target step of the route has been actualised by at least one business item, regardless of the date of those business items ...

 24           unless route_target_step_is_actualised?( route_id )

... we add the target step to the array of caused steps.

 27             @caused_steps << route_target_step( route_id )
 28           end

When the status of the route we've parsed is 'ALLOWS' ...

 31         when "ALLOWS"

... we add the target step to the array of allowed steps.

 34           @allowed_steps << route_target_step( route_id )

When the status of the route we've parsed is either 'FALSE' or 'NULL' ...

 37         when "FALSE", "NULL"

... we add the target step to the array of disallowed as yet steps.

 40           @disallowed_as_yet_steps << route_target_step( route_id )

When the status of the route we've parsed is 'UNTRAVERSABLE' ...

 43         when "UNTRAVERSABLE"

... we add the target step to the array of disallowed now steps.

 46           @disallowed_now_steps << route_target_step( route_id )

Otherwise, if the status of the route we've parsed is neither 'TRUE', 'ALLOWS', 'FALSE', 'NULL' or 'UNTRAVERSABLE' ...

 49         else

... we write to the parse log, reporting that the successfully parsed route has an unexpected status.

 52           @parse_log << "Unexpected status of #{route_status_attribute( route_id )}."
 53         end
 54       end
 55     end
 56   end
 57 end