Package com.sap.cds.services.draft
Interface DraftCreateEventContext
- All Superinterfaces:
EventContext
The
EventContext
for the DraftService.EVENT_DRAFT_CREATE
event.-
Method Summary
Modifier and TypeMethodDescriptionstatic DraftCreateEventContext
Creates anEventContext
already overlayed with this interface.com.sap.cds.ql.cqn.CqnInsert
getCqn()
com.sap.cds.Result
Returns theService
(Consumption API) of the service, targeted by theEventContext
.void
setCqn
(com.sap.cds.ql.cqn.CqnInsert cqn) Sets theCqnInsert
statementvoid
setHasActiveEntity
(boolean hasActiveEntity) Set totrue
if the draft is created from an existing active entity (edit scenario),false
otherwise (new scenario)void
Sets the result of theDraftService.EVENT_DRAFT_CREATE
eventMethods inherited from interface com.sap.cds.services.EventContext
as, get, getAuthenticationInfo, getCdsRuntime, getChangeSetContext, getEvent, getFeatureTogglesInfo, getMessages, getModel, getParameterInfo, getServiceCatalog, getTarget, getUserInfo, isCompleted, keySet, proceed, put, setCompleted
-
Method Details
-
create
Creates anEventContext
already overlayed with this interface. The event is set to beDraftService.EVENT_DRAFT_CREATE
- Parameters:
entityName
- the name of the entity- Returns:
- the
DraftCreateEventContext
-
getService
DraftService getService()Description copied from interface:EventContext
Returns theService
(Consumption API) of the service, targeted by theEventContext
. This is the service, on which theService.emit(EventContext)
method (or specialized Consumption API) was called.- Specified by:
getService
in interfaceEventContext
- Returns:
- the
Service
(Consumption API) of the service, targeted by theEventContext
.
-
getCqn
com.sap.cds.ql.cqn.CqnInsert getCqn()- Returns:
- the
CqnInsert
statement
-
setCqn
void setCqn(com.sap.cds.ql.cqn.CqnInsert cqn) Sets theCqnInsert
statement- Parameters:
cqn
- theCqnInsert
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 totrue
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 theDraftService.EVENT_DRAFT_CREATE
event
-
setResult
Sets the result of theDraftService.EVENT_DRAFT_CREATE
event- Parameters:
result
- aResult
or a list of Maps, which will be transformed into aResult
-