2017 June Release

Overriding an existing use case implementationPermanent link for this heading

Syntax

override usecase {
  variant objectclass {
    impl = ...
  }
}


You can override an existing use case implementation for the object classes belonging to your software component.

When overriding an existing use case implementation, the override keyword must precede the reference of the use case that you want to override, followed by curly braces.

Cloud profile note: Overriding an external use case from a non-friend component for an external class from a non-friend component is forbidden.

In the following example, a custom implementation is defined for COOSYSTEM@1.1:AttrContentSet in object class APPDUCXSAMPLE@200.200:Invoice.

Example

usecases APPDUCXSAMPLE@200.200
{
  import COOSYSTEM@1.1;

  override AttrContentSet {
    variant Invoice {
      expression {
        // Call super method
        cooobj.CallMethod(cootx, coometh);
        if (attrdef == #content) {
          // Initialize invoice approval process
          cooobj.COOWF@1.1:InitializeWorkFlow([#APPDUCXSAMPLE@200.200:
            ProcInvoiceApproval]);
        }
      }
    }
  }
}