It depends on the purpose of validation you are doing. As the rule names suggest, they are run before or after the end system is updated.
As per my understanding, you utilize the before operation rule to modify the information used to update the end system and after operations rule to modify the response sent back to IdentityNow after updating the end system.
Can you add a couple more logs for me and try running it to see if there are any logs.
Add a log statement on the first line of the Rule, which should execute irrespective of any logic that you have written below.
log.info("Info - Rule has been executed and logging works");
log.error("Error - Rule has been executed and logging works");
Add a log printing invalidStatus variable just before the if condition,
log.info("Info - Value of invalidStatus before condition check"+ invalidStatus);
log.error("Error - Value of invalidStatus before condition check"+ invalidStatus);
if(invalidStatus){
employeeEntry.put("employeeStatus", "Invalid");
}
If you don’t see the first log in ccg.log or error.log, I recommend you check the connector debugging configurations for more details you can check the following,
In such cases I collect all the messages using StringBuilder and then throw an Exception at the end of the codes that contains the string. You can read the contents of the exception in UI.
I know this is a dirty way, but sometimes saves me time