Interface DraftCreateEventContext

All Superinterfaces:
EventContext

public interface DraftCreateEventContext extends EventContext
  • Method Details

    • create

      static DraftCreateEventContext create(String entityName)
      Creates an EventContext already overlayed with this interface. The event is set to be DraftService.EVENT_DRAFT_CREATE
      Parameters:
      entityName - the name of the entity
      Returns:
      the DraftCreateEventContext
    • getService

      DraftService getService()
      Description copied from interface: EventContext
      Returns the Service (Consumption API) of the service, targeted by the EventContext. This is the service, on which the Service.emit(EventContext) method (or specialized Consumption API) was called.
      Specified by:
      getService in interface EventContext
      Returns:
      the Service (Consumption API) of the service, targeted by the EventContext.
    • getCqn

      com.sap.cds.ql.cqn.CqnInsert getCqn()
      Returns:
      the CqnInsert statement
    • setCqn

      void setCqn(com.sap.cds.ql.cqn.CqnInsert cqn)
      Sets the CqnInsert statement
      Parameters:
      cqn - the CqnInsert statement
    • getHasActiveEntity

      Boolean getHasActiveEntity()
      Returns:
      true if the draft is created from an existing active entity (edit scenario), false otherwise (new scenario)
    • setHasActiveEntity

      void setHasActiveEntity(boolean hasActiveEntity)
      Set to true if the draft is created from an existing active entity (edit scenario), false otherwise (new scenario)
      Parameters:
      hasActiveEntity - true if the draft is created from an existing active entity (edit scenario), false otherwise (new scenario)
    • getResult

      com.sap.cds.Result getResult()
      Returns:
      the Result of the DraftService.EVENT_DRAFT_CREATE event
    • setResult

      void setResult(Iterable<? extends Map<String,?>> result)
      Sets the result of the DraftService.EVENT_DRAFT_CREATE event
      Parameters:
      result - a Result or a list of Maps, which will be transformed into a Result