The algorithm goes through the following pseudo-code to plan a single demand.
It will call the operation solver to plan the delivery operationplans of the demand.
Erase previous delivery operation plans, except the ones that are locked
Optionally, the Enterprise Edition can also erase upstream supply
Clear the list of constraints of this demand
Find the delivery operation, either defined on the demand itself or the items delivery operation
If no delivery operation can be identified
Flag the demand as unplannable
Set ask date = due date
Loop until the full demand quantity is planned
Call solver of the delivery operation with arguments(missing quantity,ask date)
If planned quantity = 0 then
Call solver of the delivery operation with arguments(minimum delivery quantity,ask date)
If the planned quantity is non-zero this time then
Iteratively try to plan increasing quantities to find the maximum feasible quantity (bisection method)
If planned quantity = requested quantity,
Commit/accept the new operation plans
else if the demand planning policy allows planning the demand in parts and remaining quantity would be less than the minimum then
Rollback/refuse the new operation plans
Remember the date and quantity (*)
Else
Rollback/refuse the new operation plans
If planned quantity > 0 then
// This step synchronizes all supplying paths for the quantity of the most constrained path
Call solver of the delivery operation with arguments(planned quantity, ask date)
Commit the operation plan creation
Update the planned quantity for the next iteration in the loop
Update the ask date for the next iteration in the loop, based on the reply date of the operation
Exit the loop if the demand can’t be planned late
If the demand is not fully planned and there is a temporarily rejected plan from step (*) then
Commit/accept the plan that was rejected before