I have a published WS that will receive an Object that will be saved in the data base of the application of the published WS. I know that in mendix modeler,the Object is committed once received at the published WS.and surly my application needs to validate the received object first before committing . so,I have 2 solutions either using another dummy Object just for WS and then check my validation first before creating an object that I need and then clearing the dummy one OR using java action . In case the Object has many associations also the related object will be committed if I use the real object So what is the best solution to handle a situation like this.
I think the best method is to use a microflow in your published webservice where it now does a Find or Create.
That way you can do all your validation and assocation setting straight away.
Robert van 't Hof
Just do the validation in the microflow that's published. If you want to abstract it away a bit, you can call a subflow as the first activity in the microflow and do all validation there.
Alternatively, just add either validation rules or a before commit microflow.