Guidelines

If the method has processing order ‘batch’ then the on execute hook is linked to the top-level component (the business object level). In that case the whole request must be used. In other cases, only the attribute values from the current component and identifying attributes from the parent components (if any) can be used.

In a before execute hook it is not allowed to change the object instance being processed (either its attribute values or its persistent data in the database).

Output parameter io.cancel can be set. This is a boolean that indicates whether the method execution must be cancelled. If it is not set, the default value is false.

If a business object consists of multiple components, the cancel is handled as shown in the following picture.

In case of a bottom-up method (for example Delete), if a cancel occurs on a component instance, the method is not executed for that component and its parents. A cancel on 1.1 results in skipping the method for 1.1 and 1, but also for 1.1.1 and 1.1.2. So 1.2 is processed. In case of a top-down method (for example Create), if a cancel occurs on a component instance, the method is not executed for that component and its children. A cancel on 1.1 results in skipping the method for 1.1, 1.1.1 and 1.1.2.

These rules apply to standard and specific methods.

In case of a Change method, the situation is not that straightforward, because a change combines the top-down and the bottom-up approach. A change may include create or delete actions on subcomponents. A cancel on a delete for a child, does not impact the change on the header! Three cancel situations are shown in the following example.