Hi Ratna,
Yes we can do that.
1. First, group those events in Expected event profile and make relative to Unique Event e-g check LTL_EE_OCEAN Expected Event profile
2. Config as per Vishnu suggestion IS_EVENT_REPORTED to check previous event and then if it is success.
3. Create custom activity function to retrieve param value from Y event message and perform validation.
4. If it is successful, then process Z event message.
Few challenges on this:
1. If you don't receive Y event message on time and Z message comes into the system before Y, then Z message will fail.
2. If parameter missing Y event message and Z message will fail as it checks dependency.
We had faced many issues in one of the project when made dependency and found most of the time previous events were not sent on time. At the outset, we forced to post Z though Y was not reported.
Regards
GGOPII