I have a BO called Entity and for each of the next 12 months I need to create instances in another BO called EntityCapexForecast.
The EntityCapexForecast BO looks like
Entity Entity
EntitySC Shortcut
FCastCapexValue Number
Period Date
So I needed a process that creates a EntityCapexForecast record for each of the next 12 months for each Entity.
I created a Process with two Rules...
Rule 1: Find All Entities
Action 1: FIND ALL Entity IN BATCHES OF 1
Rule 2:
Condition 1:
NOT(EXISTS EntityCapexForecast WHERE (EntityCapexForecast.Entity=Entity AND EntityCapexForecast.Period=LAST_DAY_OF_MONTH(MONTH_ADD(ReportingPeriods.Period,LOOP_ITERATION-1))))
Action 1:
CREATE EntityCapexForecast FOR EACH NUMBER BETWEEN 1 AND 12 WITH EntityCapexForecast.Entity=Entity,EntityCapexForecast.Period=LAST_DAY_OF_MONTH(MONTH_ADD(ReportingPeriods.Period,LOOP_ITERATION-1))
This works perfectly EXCEPT..... it never terminates.
Maybe I cannot see the wood for the tress but can anyone spot the problem please?
Cheers,
Mark