2017 June Release

Use case wrappers with dataPermanent link for this heading

Use case wrappers allow defining reusable building blocks with a standard implementation and polymorphism to override the default behavior.

A use case wrapper may define a prototype, a virtual application prototype, a method definition or a virtual application.

  • COOSYSTEM@1.1:ucwprototype
  • FSCVAPP@1.1001:ucwprototype
  • COOSYSTEM@1.1:ucwmethdefinition
  • FSCVAPP@1.1001:ucwapplication
  • Cloud profile note: The definition of use case wrappers is not allowed.

Example

app.ducx Use Case Language

/**
* Default implementation for signature wrappers. If no selection is supplied,

* it is applied to “sys_object”. If “signtype” is not available for any

* reason, an exception is thrown.
*/

usecase SignObjects(parameters as FSCVAPP@1.1001:MenuPrototype) {
  variant Object {
    application {
      expression {
        if (!sys_selobjects) {
          sys_selobjects = sys_object;
        }
        Action sys_action;
        SignatureType signtype = sys_action.signtype;
        if (!signtype) {
          throw #SIGNERR_IllegalType;
        }
        ->SignSelectedObjectsApp(sys_object, sys_action, sys_view,
              sys_selobjects, sys_selindices, sys_dynkey, signtype, null);
      }
    }
  }
}

app.ducx Object Model Language

/**
* Defines a signature wrapper with a default virtual application

* implementation (“SignObjects”).

*/

class<UseCaseWrapper> SignatureWrapper : UseCase {
  ucwapplication = ObjectSignObjects;
  SignatureType signtype not null;
}

app.ducx Use Case Language

/**
* “SignWithMenuInitial” creates a menu use case; it is implemented as

* virtual application defined in “SignatureWrapper”

*/

menu usecase<SignatureWrapper> SignWithMenuInitial {
  signtype = SIGN_INITIAL;
}