Mandatory Fields

This option allows the developer to specify mandatory fields for any given parameter. Mandatory fields are fields that must be populated when displayed on a client page.

The option value must be populated with a single line, comma delimited string.

Consider the following operation:

Figure 1. Operation Signature
public interface Employer
{
  public void updateEmployerDetails(
      PersonDetails personDtls
      EmploymentDetails employmentDetails)
    throws AppException, InformationalException;
}

The pseudo-code for the structures involved as parameters in this operation is outlined below:

Figure 2. Pseudo-Code for Parameter Structures
// Note that since a person can have two addresses,
// PersonDetails aggregates AddressDetails twice
// - "homeAddress" and "workAddress".
struct PersonDetails {
  String firstName;
  String surname;
  AddressDetails homeAddress;
  AddressDetails workAddress;
}
// The role name for the struct aggregation between
// PersonDetails and AddressDetails "homeAddress" struct
// is set to "homedtls"
struct AddressDetails {
  String addressLine1;
  String addressLine2;
  String city;
  String country;
}
// Note that EmploymentDetails aggregates AddressDetails once.
// The role name for the struct aggregation between
// EmploymentDetails and AddressDetails "employerAddress"
// struct is set to "employmentdtls"
struct EmploymentDetails {
  String employerName;
  Date employmentStartDate;
  AddressDetails employerAddress;
}

In this example, we want to make the following fields mandatory for our operation parameter:

For the personDtls parameter:

For the employmentDetails parameter:

Set theMandatory Fields option of parameter personDtls to:

firstName, homeAddress.addressLine1

Set theMandatory Fields option of parameter employmentDetails to:

employerAddress.addressLine1

Therefore, if adding mandatory fields that are contained in structures aggregated by the parameter type class, they must be fully qualified by the relevant aggregation role names as shown above.