Implementing a Custom Action
To implement a working custom action, two classes must be implemented:
com.tibco.governance.agent.action.Action
com.tibco.governance.agent.action.ActionConfigurationProcessor
The
com.tibco.governance.agent.action.Action
class instance is created and initialized by the configuration processor when an action is first deployed and started. It also accepts an action context parameter by a run method. This run method is called each time the policy is invoked. This method may implement the complete execution logic.
To create a custom action, create a new Java-plugin project first.
- Procedure
- Clear the
Generate an activator, a Java class that controls the plug-in's life cycle and
This plug-in will make contributions to the UI checkboxes. Click
Finish. An empty plug-in project is created. MANIFEST.MF is created in the META-INF folder.
- Open the
MANIFEST.MF file. Under
Imported Packages, click
Add. Add the
com.tibco.governance.agent
,com.tibco.governance.agent.action
, andcom.tibco.governance.agent.action.api
packages. Save the file. - Create a
CustomAction class to implement the
com.tibco.governance.agent.action.Action
class. Edit the class to implement the Action Interface and import the packagecom.tibco.governance.agent.action
. Also, add the not implemented methods.The class is created as shown: - In addition to the action class, create
CustomActionConfigurationProcessor
which implements thecom.tibco.governance.agent.action.ActionConfigurationProcessor
. This class invokes and initializes the action.ActionConfigurationProcessor
is the action manager and it initializes the action class. - After these two classes are created, add the business logic.
For more details on the location of the sample Request Counter, see Request Counter in Sample Action Source Code.
- After the business logic has been added, ensure that the custom action package is exported into
MANIFEST.MF.
The action can now be packaged into an ActiveMatrix composite (to be deployed on ActiveMatrix).
Subtopics