code: public void onAzureBatchTaskStatus(final CloudTask cloudTask) {
      ResourceStatusEventImpl.Builder eventBuilder =
          ResourceStatusEventImpl.newBuilder()
              .setIdentifier(cloudTask.id())
              .setState(TaskStatusMapper.getReefTaskState(cloudTask))
              .setRuntimeName(RuntimeIdentifier.RUNTIME_NAME);
  
      if (TaskState.COMPLETED.equals(cloudTask.state())) {
        eventBuilder.setExitCode(cloudTask.executionInfo().exitCode());
      }
  
      this.reefEventHandlers.onResourceStatus(eventBuilder.build());
    }
docs: Takes in an instance of {@link CloudTask}, generates and triggers a
  {@link org.apache.reef.runtime.common.driver.resourcemanager.ResourceStatusEvent}.
  
  @param cloudTask and instance of {@link CloudTask}.