Description
This method adds an Attribute to a given Domain.
Original Name vs GenRocket Name
GenRocket defines two names for an given Attribute, the originalName and the genrocketName.
- originalName - the actual name of the given (column, field, etc).
- Example database column names
- last_name
- first_name
- customer_id
- Example field names
- drivers-license
- SocialSecurityNumber
- EmployeeId
- Example database column names
- genrocketName - the originalName converted to camelCase
- Examples:
- lastName
- firstName
- customerId
- driversLicense
- socialSecurityNumber
- employeeId
- Examples:
API Attribute Naming Convention
Always use the originalName for the attributeName parameter. An attributeName has the format of domainName.originalName. Since one or more Domains may exist within a given Scenario and since one or more Domains within a given Scenario may contain Attributes with the same name, the originalName must be prepended with the domainName. If the domainName is not contained as the prefix of an attributeName, the attribute cannot be found.
- Examples:
- attributeAdd(User.last_name)
- attributeAdd(Account.customer_id)
- attributeAdd(Employee.SocialSecurityNumber)
Exceptions
The following GenRocket exceptions may be thrown by this method:
- If the runtime instance is currently running another Scenario.
- If the requested domainName is not found.
- If a duplicate attributeName is found.
Runtime Method Signature
Use this method signature when directly accessing the GenRocket binary runtime.
public void attributeAdd(String attributeName)
REST/Socket Payload Request
Use this API JSON request payload when making an API call to the GenRocket REST or Socket Engine.
{ "interfaceType": "Manual", "methodName": "attributeAdd", "parameters": { "attributeName": "" } }
REST/Socket Payload Successful Payload Response
The API JSON response payload for this method will be empty.
{ "responseType": "OK", "data": "" }