...
The metadata for each property consists of the following attributes:
Attribute | Description |
---|---|
Active | Whether this property is in use for the integration. Allows hiding the property without removing it. |
Code | A unique, required name which is used by the API and other scripts, and therefore must following keyword limitations of Java and Groovy (e.g. no spaces or special characters other than underscore). |
Display Name | A name for the property which will be displayed for data entry rather than the technical Key Name. |
Description | A meaningful description of what the property is used for. |
Required | Whether or not a value for the property is required for CMS instances using this provider. Implementations should use default values in the Java/Groovy class or script for any optional properties. |
Data Type | The data type for the property. Supported types - String, Boolean, Integer, or Double, |
Sub-Type | An optional qualifier describing the type of data the property will contain. This is used to validate the data entry. Supported types - URL, JDBCURL, or Directory. Simply leave blank if none of these qualifiers are applicable. |
Encrypted | Indicates whether the property is secure and should be encrypted when stored, and care should be taken not to print their values in the logs. |
Values for these properties will be provided when instances of this CMS are created.
...
In order to compile your java class, you will need FlexDeployAPI.jar on classpath.
Implement all the methods described in the table in the API Implementation section.
For any failure connecting to the system or if any issues with the data, then you can throw exception. For example throw new ApiException("Invalid credentials.", "");
Once you are ready with unit testing, you can prepare Jar file for your credential store java class and other utility classes. This jar file can be placed on server classpath now.
For Tomcat, put this jar file in apache-tomcat-flexdeploy/lib folder.For WebLogic, put this jar file in Domain lib folderlibext folder.
If you are using any third-party libraries from your Java implementation, then those jar files will also need to be added to same lib libext folder. Keep in mind that this can cause issues with server functioning, so be prepared to remove your additional library files.
To pickup changes to your API, the FlexDeploy server must be restarted.
...
As groovy is able to access FlexDeploy variables and Java classes, you can take advantage of Java libraries from Groovy script. For example, if there is Java library used to access the change management system, you can places place those in lib the libext folder and use those classes from Groovy script. This allows you to keep the dynamic part of implementation in Groovy and use a Java library.
Create a groovy class. Example shown below has the methods implemented.
We are using Zendesk as a use case
All properties defined are available as groovy binding variables. For example, properties can be accessed directly like BMC_DOMAIN_NAME, BMC_SALESFORCE_HOST_NAME or BMC_USER_NAME etc
...
log is a FlexDeploy logger variable which should be used to log any information from the groovy class.
fdrestutils is a utility object available to use FlexDeploy API to invoke any REST API. See the Java docs for more details on the functions available.
...