Server Side Validation of MOPD
Rules can be configured for server side validation of the manually created plan. When the plan is executed then it is validated for the rules configured onthe server side. And if the validation fails the user needs to update the plan and execute it again.
All the rules for the server side validations can be configured in file: $AF_HOME/roles/omsServer/standalone/config/mopd_validate_config.xml including the system and custom rules.
Server side validations include:
- System rules implemented by application - Circular dependency in plan is checked by application. If circular dependency is found in the manually edited plan, plan cannot be executed further.
- Third party rules - User can configure custom rules for validating the manually created plan. The following steps enable custom rules:
- Define the classes implementing the custom rule. Build the code and copy the .jar file to $AF_HOME/roles/omsServer/standalone/lib.
- All the classes configured in step mentioned earlier must implement the interface
com.tibco.aff.eca.base.Action and must implement a method with name EXECUTE. The method signature looks like the following code:
@Override public void execute(MopdContext mopdContext) { String currentMethod = "execute"; if(log.isDebugEnabled()) log.debug(null,currentMethod,null,"Entering Method {}", currentMethod); Plan plan = mopdContext.getPlan(); mopdContext.setPlanValid(true); try { isCircularDependency(plan); } catch (Exception e) { mopdContext.setPlanValid(false); } if(log.isDebugEnabled()) log.debug(null,currentMethod,null,"Exiting Method {} --> Validating Plan with planId: [{}] and orderId: [{}] ", currentMethod, plan.getPlanID(), plan.getOrderID()); return; }
- Build the code and copy the .jar file to $AF_HOME/roles/omsServer/standalone/lib.
- Configure the rule for plan validation in file: $AF_HOME/roles/omsServer/standalone/omsServer/mopd_validate_config.xml.
- Restart the OMS Server.
- Custom rules work the same way as the system rule. The bean definition for classes involved in custom rule is defined in application context file and for custom rule classes are defined and loaded.
Copyright © Cloud Software Group, Inc. All rights reserved.