Get Activity Failure or Success status from Activity Interceptors

Hello,

I need to send the activity status before and after the activity to another system.
output.results() just returns the activity response. how can i get the activity status (Sucess or Failure with Message) and publish to another system

I have used Activity Interceptors as below

@Slf4j
public class TestActivityInboundInterceptor extends ActivityInboundCallsInterceptorBase {
    private ActivityExecutionContext activityExecutionContext;
    private Someservice service;
    public TestActivityInboundInterceptor(ActivityInboundCallsInterceptor next,Someservice service) {
        super(next);
        this.service=service;
    }
    @Override
    public void init(ActivityExecutionContext context) {
        this.activityExecutionContext = context;
        super.init(context);
    }
    @Override
    public ActivityOutput execute(ActivityInput input) {
        log.info("Entering TestActivityInboundInterceptor");		
		service.publish();
        ActivityOutput output= super.execute(input);
	**log.info(output.results());**
	service.publish();
    }
}

ActivityOutput.getResult() returns a Promise that contains either a result or failure.

Thanks .

I see ActivityInboundCallsInterceptor.ActivityOutput returns activity response.

I see only WorkflowOutboundCallsInterceptor.ActivityOutput returns promise but activity failure i dont see it hitting this class .

Appreciate your help on this. i have this implemented as below. not sure if this the efficient way of getting status . .can you please provide some sample code from which interceptors i can pull the activitystatus

@Slf4j
public class TestActivityInboundInterceptor extends ActivityInboundCallsInterceptorBase {
private ActivityExecutionContext activityExecutionContext;
private Someservice service;
public TestActivityInboundInterceptor(ActivityInboundCallsInterceptor next,Someservice service) {
super(next);
this.service=service;
}
@Override
public void init(ActivityExecutionContext context) {
this.activityExecutionContext = context;
super.init(context);
}
@Override
public ActivityOutput execute(ActivityInput input) {
log.info(“Entering TestActivityInboundInterceptor”);
service.publish();
try{
ActivityOutput output= super.execute(input);
log.info(output.results());
if(!ObjectUtils.isEmpty(output.getResult())){
service.publish();
}
}
catch(ApplicationFailure e){
//set the status to failed
service.publish;
}

}

}