yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Quintiq file version 2.0
#parent: #root
Method Repeat (LibOpt_Task task, LibOpt_TaskContextIterator context) as stream[JSON]
{
  Description:
  [*
    Helper method for iterators that work by recursively calling the `Operation` method multiple times on the same task.
    This is intended to be called reactively after termination of an iteration. It updates the counters in the given task context and reexecutes `Operation`, returning the result stream.
    If this method is used, the `Operation` method must first check the iterator's stop criterion before possibly spawning new transactions.
    The `Operation` method must also increase the `LibOpt_TaskContextIterator.NrOfSubtasks` attribute with each reactively spawned iteration.
  *]
  TextBody:
  [*
    context.NrOfIterations( context.NrOfIterations() + 1 ); // an iteration has finished.
    context.NrOfSubtasks( context.NrOfSubtasks() - 1 ); // the iteration has ended. It should not be counted as a running subtask anymore.
    return this.Operation( task );
  *]
  InterfaceProperties { Accessibility: 'Module' }
}