Show TOC

Creating Application Service OperationsLocate this document in the navigation structure

Use

You can create custom operations to make the logic of your application more flexible.

Procedure
  1. Open the Operations tab page of the TravelLocationApp application service and choose Add.
  2. For the type of your application choose Custom Operation.
  3. Configure the following data:
    • In the Name field, enter findById.
    • In the Description field, enter Find a trav el location by id.
    • From the Transaction typedropdown box, select REQUIRED.
    • From the Permission check dropdown box, select Disable.
  4. Choose Finish.
  5. In the Operations Parameters list:
    1. Navigate to caf.core → faults → Data Types → Faults →  CAFServiceException and choose Add to Fault.

      This way the operation can throw the CAFServiceException , which is the base for all the exceptions thrown by the business object nodes services.

    2. Navigate to caf.core → primitive → Data Types → Simple Types →  LONGand choose Add to Input. Name the parameter id .
    3. Navigate to carpool → modeled → Data Types → Complex Types → TravelLocationand choose Add to Output. Name the parameter TravelLocation .
  6. Repeat steps above to create a similar operation for retrieving all available travel locations - getAll . Change the Cardinalityfrom the Propertiesview to 0..n.
    Operation Name Input Parameter Output Parameter Cardinality Fault

    getAll

    Empty

    TravelLocation

    0..n

    CAFServiceException

Result

You have created two operations that do the following:

  • Search for a travel location by id
  • Retrieve all travel locations

Step 6:

Implementing Application Service Operations