Creating Application Service
Operations
You can create custom operations to make the logic of your application more flexible.
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 travel location by id.
¡ From the Transaction type dropdown box, select REQUIRED.
¡ From the Permission check dropdown box, select Disable.

4. Choose Finish.
5. In the Operations Parameters list:
...
i. 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.
ii. Navigate to caf.core → primitive → Data Types → Simple Types → LONG and choose Add to Input. Name the parameter id.
iii. Navigate to carpool → modeled → Data Types → Complex Types → TravelLocation and 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 Cardinality from the Properties view to 0..n.
Operation Name |
Input Parameter |
Output Parameter |
Cardinality |
Fault |
getAll |
Empty |
TravelLocation |
0..n |
CAFServiceException |
You have created two operations that do the following:
● Search for a travel location by id
● Retrieve all travel locations