I have method A in my Spring backend project that should be invoked after execution of different method - B. Returning type of method B is void, but I need to pass one input parameter from method B to method A, after successful execution of method B.
Method B:
void invite(int eventId, int userId, Integer[] invitees,
EventInvitationMethod push, String content);
Method A:
@AfterReturning(pointcut="execution(* xyz.zzz.api.event.service.EventService.invite(..))")
public void newInvitation(InputParameter of B - int userId){
///Do something with userId
}
Is it possible to do that? I need to be sure, that method B was executed successfully to process method A.
Any help will be great.