Splash › Forums › Rewrite Users › How to get property in HttpCondition? › Reply To: How to get property in HttpCondition?
If a custom HttpOperation does not work, you need to use:
ParameterStore store = (ParameterStore) evaluationContext.get(ParameterStore.class);
ParameterValueStore store = (ParameterValueStore) evaluationContext.get(ParameterValueStore.class);
The best way to get the parameter store is to implement the Parameterized interface: https://github.com/ocpsoft/rewrite/blob/master/api/src/main/java/org/ocpsoft/rewrite/param/Parameterized.java
Rewrite will pass you the parameter store on Rule instantiation, and it also allows you to specify the parameter names that are required for your Condition/Operation.
If your condition does not need to be re-used/configurable, you can “cheat”, and get them directly from the EvaluationContext.
Those two classes will allow you to retrieve parameters and their current stored values.
If you find our tools useful, please consider making a donation to help us stay online and building software!