Skip to main content

RECOVERY

attribute := expression : RECOVERY(handler [, attempts]) ;

attributeThe name of the Attribute.
expressionThe definition of the attribute.
handlerThe action to run if the expression fails.
attemptsOptional. The number of times to try before giving up.

The RECOVERY service executes the handler Attribute when the expression fails then re-runs the attribute. If the attribute still fails after the specified number of attempts, any present FAILURE clause will execute. RECOVERY notionally executes in parallel with the failed return result. This service implicitly causes the attribute to be evaluated at global scope instead of the enclosing scope. Only available if workflow services are turned on (see #OPTION(workflow)).

Example:

  DoSomethingToFixIt := TRUE; //some action to repair the input
  
  SPeople := SORT(Person,Person.per_first_name);
  
  nUniques := DEDUP(sPeople,Person.per_first_name AND Person.address)
           :RECOVERY(DoSomethingToFixIt,2),
            FAILURE(Email.simpleSend(SystemsPersonel,
                    SystemsPersonel.email,
                    'ouch.htm'));

See Also: SUCCESS, FAILURE