Server-Side Validation of Manual Order Plan Development
Rules can be configured for server-side validation of the manually created plan. When the plan is run then it is validated for the rules configured on the server-side. And if the validation fails the user needs to update the plan and run it again.
All the rules for the server-side validations can be configured in file: $OM_HOME/roles/omsServer/standalone/config/mopd_validate_config.xml including the system and custom rules.
Server-side validations include:
- System rules implemented by the application - Circular dependency in the plan is checked by the application. If circular dependency is found in the manually edited plan, the plan cannot be run further.
- Third-party rules - The 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 $OM_HOME/roles/omsServer/standalone/lib.
- All the classes configured in the step mentioned earlier must implement the interface
com.tibco.aff.eca.base.Action
and must implement a method with the 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 $OM_HOME/roles/omsServer/standalone/lib.
- Configure the rule for plan validation in the file: $OM_HOME/roles/config/standalone/omsServer/mopd_validate_config.xml.
- Restart the Order Management Server.
- Custom rules work the same way as the system rule. The bean definition for classes involved in the custom rule is defined in the application context file and for custom rule classes are defined and loaded.