...
...
...
...
You can create a custom plugin using the following three options:
- Script
- Custom APIs
- Spring Bean
To create a custom plugin activity:
...
Click Configure > EXTENSIONS > Custom Plugin.
...
...
String getname =service.getValueByName("username");
System.out.println("USERNAME" + getname);
...
Expand | ||
---|---|---|
| ||
In this option, you need to define the Java code which is parsed and executed during the process flow execution. The following list gives you a clear idea about the pros and cons associated with this approach. Pros:
Cons:
|
...
title | Custom API |
---|
Using this option enhances the performance of the process flow execution. In this option, you need to select the class and its method for the execution of the process flow. The process flow will be executed on the basis of the code implemented in the selected method.
Info |
---|
The Custom API approach uses the traditional Java Reflection technique to load the class dynamically, instantiate it, and invoke the specified method. This technique has a performance impact under heavy load and therefore has been marked as deprecated. This option is available in the custom plugin activity for backward compatibility purpose only. |
To create a custom plugin using custom APIs, first create a class with method(s) and put that in the .../<AdeptiaInstallFolder>/ServerKernel/customClasses/<ClassPackage> folder where <ClassPackage> is the package where you have defined the Java class. For example, if you have defined the Java class in the org.custom package then first create the org/custom folder in the .../<AdeptiaInstallFolder>/ServerKernel/customClasses folder and put the class in the custom folder. Ensure that the following conditions are fulfilled:
The class must implement PluginExecutor interface.
Code Block |
---|
public class <class_name> implements PluginExecutor |
The method should accept only one parameter and that must have an object of ExecutionEvent.
Code Block |
---|
public boolean <method_name>(ExecutionEvent event) throws Exception |
...
The following list gives you a clear idea about the pros and cons associated with this approach.
Pros:
- Works better than the script approach under high load. However, Adeptia recommends to use spring bean approach as it is more optimized and works better than a custom plugin.
Cons:
- Every time you need to either develop a new or update the existing Java bean class.
- You must restart Adeptia services to bring the changes into effect.
- It is slower in execution than Spring Bean approach.
...
title | Spring Bean |
---|
In this option, you need to define the spring bean file and place that in customClasses\custom\beans folder. This option improves the execution of custom plugin under heavy load of concurrent execution of process flows.
To use Spring Bean in Custom Plugin, you first need to create a Custom Class file and place it customClasses\custom\beans folder.
Follow the steps below to create the custom class:
...
Info |
---|
This class should define the execute method that accepts ExecutionEvent instance as an argument. The ExecutionEvent instance will be passed that contains information about the runtime variables that are required to execute the business logic. The variables are:
|
...
Compile the class.
Info |
---|
Ensure that you have the following Jars in the class path to successfully compile the above class.
|
...
Put this class into the customClasses folder.
Once you have created a custom class, perform the following steps to use it in Custom Plugin:
- Create a custom\beans folder in the .../<AdeptiaInstallFolder>/ServerKernel/customClasses path and place the spring bean file in customClasses\custom\beans folder which you can use as Spring Bean.
...
Info |
---|
Restart the Adeptia services to bring the changes into effect. |
Once defined, this bean name will be displayed in the Spring Bean Name drop-down list.
The following list gives you a clear idea about the pros and cons associated with this approach.
Pros:
- High performance under heavy load of concurrent execution of process flows.
Cons:
...
Info |
---|
In case of high-performance needs under heavy load, Adeptia recommends using the Spring Bean option where the class instantiation and management is done by Adeptia Spring container which is highly optimized. |
...
...
title | Encrypting the variables using Vault |
---|
...
- Following an opening curly parentheses, 'Vault' is a keyword (V in 'Vault' is UPPERCASE).
- aliasName is the Vault Alias, where the parameter is defined.
- key is the parameter which stores the Variable Value.
- Finally closed by a closing curly parentheses.
- A period is used as a separator between Vault and aliasName; and aliasName and key.
...
title | Fetching the variables in the script |
---|
Once the variables are defined in Step 5 above, you can fetch their values in the script through following syntax-
...