In order to build the modular assertion run ./gradlew clean build
This will compile, test, and create the jar file. It will be available in build/libs
In order to build the custom assertions the CA API Gateway API jar is required to be put into the lib directory.
Docker version of Gateway greatly helps us to deploy assertions / RESTMAN bundles quickly. Please follow the steps below to run the container Gateway prepopulated with this example assertion and example services.
- Open Shell or Command Prompt and navigate to the directory where this repository is cloned.
- Build the Assertion
gradle build
- Ensure your docker environment is properly setup.
- Provide the CA API Gateway license at
docker/license.xml
. - Execute the below docker-compose command to run the CA API Gateway container.
docker-compose up
- Provided
docker-compose.yml
ensures pulling the latest CA API Gateway image from the Docker Hub public repository and deploys the assertion that was just build.
- Provided
- Wait until the Gateway container is started and is ready to receive messages.
This assertion can evaluate a mathematical expression. The expression may contain context variables, parantheses, and common math functions. The result is stored in a context variable. The precision of the result is also adjustable. Available functions include:
- ABS: the absolute value of the parameter
- ACOS: arccos or cos-1 of the parameter
- ASIN: arcsin or sin-1 of the parameter
- ATAN: arctan or tan-1 of the parameter
- CBRT: the cube root of the parameter
- CEIL: the ceiling of the parameter
- COS: cosine of the parameter
- COSH: hyperbolic cosine of the parameter
- EXP: raises the constant e to the power of the parameter
- EXPM1: raises the constant e to the power of the parameter and subtracts 1
- FLOOR: the floor of the paramter
- LOG: the natural logarithm of the parameter
- SIN: sine of the parameter
- SINH: hyperbolic sine of the parameter
- SQRT: square root of the parameter
- TAN: tangent of the parameter
- TANH: hyperbolic tangent of the parameter
Contributions are welcome and much appreciated. To learn more, see the Contribution Guidelines.
Copyright (c) 2018 CA. All rights reserved.
This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details.