API event - RapturePlatform/Rapture GitHub Wiki
Events are used to coordinate large scale activity in Rapture. The process is relatively simple: a caller assigns any number of scripts to a named event (simply a unique path), and then when the event is fired all attached scripts are scheduled for execution. Some events are internally managed (system events) and other events can be user created and managed.
HttpEventApi eventApi = new HttpEventApi(loginApi);
RaptureEvent retVal = eventApi.getEvent(eventUri);
retVal = baseAPI.doEvent_GetEvent(eventUri);
Entitlement: /event/admin
This method is used to retrieve information about an event (primarily the scripts attached to it).
Parameter | Type | Description |
---|---|---|
eventUri | String |
Type | Description |
---|---|
RaptureEvent |
Describes the main object used by the Event API.
Field | Type |
---|---|
uriFullPath | String |
scripts | Set(RaptureEventScript) |
messages | Set(RaptureEventMessage) |
notifications | Set(RaptureEventNotification) |
workflows | Set(RaptureEventWorkflow) |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.putEvent(event);
retVal = baseAPI.doEvent_PutEvent(event);
Entitlement: /event/admin
This method puts an event in the system.
Parameter | Type | Description |
---|---|---|
event | RaptureEvent |
Type | Description |
---|---|
void |
Describes the main object used by the Event API.
Field | Type |
---|---|
uriFullPath | String |
scripts | Set(RaptureEventScript) |
messages | Set(RaptureEventMessage) |
notifications | Set(RaptureEventNotification) |
workflows | Set(RaptureEventWorkflow) |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.deleteEvent(eventUri);
retVal = baseAPI.doEvent_DeleteEvent(eventUri);
Entitlement: /event/admin
This method removes an event (and any attached scripts) from the system. If the event is fired at a later point nothing will happen as there would be no scripts attached.
Parameter | Type | Description |
---|---|---|
eventUri | String |
Type | Description |
---|---|
void |
HttpEventApi eventApi = new HttpEventApi(loginApi);
List<RaptureFolderInfo> retVal = eventApi.listEventsByUriPrefix(eventUriPrefix);
retVal = baseAPI.doEvent_ListEventsByUriPrefix(eventUriPrefix);
Entitlement: /user/get
Return a list of full display names of the paths below this one. Ideally optimized depending on the repo.
Parameter | Type | Description |
---|---|---|
eventUriPrefix | String |
Type | Description |
---|---|
List |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.addEventScript(eventUri, scriptUri, performOnce);
retVal = baseAPI.doEvent_AddEventScript(eventUri, scriptUri, performOnce);
Entitlement: /event/admin
This method is used to attach a script to an event. A final parameter signals whether this script should be detached from the event when it is fired.
Parameter | Type | Description |
---|---|---|
eventUri | String | |
scriptUri | String | |
performOnce | boolean |
Type | Description |
---|---|
void |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.deleteEventScript(eventUri, scriptUri);
retVal = baseAPI.doEvent_DeleteEventScript(eventUri, scriptUri);
Entitlement: /event/admin
This method detaches a script from the event.
Parameter | Type | Description |
---|---|---|
eventUri | String | |
scriptUri | String |
Type | Description |
---|---|
void |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.addEventMessage(eventUri, name, pipeline, params);
retVal = baseAPI.doEvent_AddEventMessage(eventUri, name, pipeline, params);
Entitlement: /event/admin
This method is used to attach a message to an event. When the event is fired a message is sent to the pipeline with content based on the context of the event and parameters passed to this call.
Parameter | Type | Description |
---|---|---|
eventUri | String | |
name | String | |
pipeline | String | |
params | Map<String,String> |
Type | Description |
---|---|
void |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.deleteEventMessage(eventUri, name);
retVal = baseAPI.doEvent_DeleteEventMessage(eventUri, name);
Entitlement: /event/admin
This method reverses the message attachment, using the same name as passed in the original attachMessage call
Parameter | Type | Description |
---|---|---|
eventUri | String | |
name | String |
Type | Description |
---|---|
void |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.addEventNotification(eventUri, name, notification, params);
retVal = baseAPI.doEvent_AddEventNotification(eventUri, name, notification, params);
Entitlement: /event/admin
This method is used to attach a notification to an event. When the event is fired a message is sent to the notification with content based on the context of the event and parameters passed to this call.
Parameter | Type | Description |
---|---|---|
eventUri | String | |
name | String | |
notification | String | |
params | Map<String,String> |
Type | Description |
---|---|
void |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.deleteEventNotification(eventUri, name);
retVal = baseAPI.doEvent_DeleteEventNotification(eventUri, name);
Entitlement: /event/admin
This method reverses the notification attachment, using the same name as passed in the original attachNotification call
Parameter | Type | Description |
---|---|---|
eventUri | String | |
name | String |
Type | Description |
---|---|
void |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.addEventWorkflow(eventUri, name, workflowUri, params);
retVal = baseAPI.doEvent_AddEventWorkflow(eventUri, name, workflowUri, params);
Entitlement: /event/admin
This method is used to attach a workflow (dp) to an event. When the event is fired an instance of the workflow is started.
Parameter | Type | Description |
---|---|---|
eventUri | String | |
name | String | |
workflowUri | String | |
params | Map<String,String> |
Type | Description |
---|---|
void |
HttpEventApi eventApi = new HttpEventApi(loginApi);
void retVal = eventApi.deleteEventWorkflow(eventUri, name);
retVal = baseAPI.doEvent_DeleteEventWorkflow(eventUri, name);
Entitlement: /event/admin
This method reverses the notification attachment, using the same name as passed in the original attachWorflowToEvent call.
Parameter | Type | Description |
---|---|---|
eventUri | String | |
name | String |
Type | Description |
---|---|
void |
HttpEventApi eventApi = new HttpEventApi(loginApi);
boolean retVal = eventApi.runEvent(eventUri, associatedUri, eventContext);
retVal = baseAPI.doEvent_RunEvent(eventUri, associatedUri, eventContext);
Entitlement: /event/admin
This method fires an event, scheduling any attached scripts to run. The optional displayName and contextparameters are passed to the script when fired.
Parameter | Type | Description |
---|---|---|
eventUri | String | |
associatedUri | String | |
eventContext | String |
Type | Description |
---|---|
boolean |
HttpEventApi eventApi = new HttpEventApi(loginApi);
RunEventHandle retVal = eventApi.runEventWithContext(eventUri, associatedUri, eventContextMap);
retVal = baseAPI.doEvent_RunEventWithContext(eventUri, associatedUri, eventContextMap);
Entitlement: /event/admin
This method fires an event, scheduling any attached workflows or scripts to run. The optional associatedURI and contextmap are passed to the event workflow when fired. The event's unique id is returned. This id is passed to any scripts, workflows, etcinvoked by the event
Parameter | Type | Description |
---|---|---|
eventUri | String | |
associatedUri | String | |
eventContextMap | Map<String,String> |
Type | Description |
---|---|
RunEventHandle |
This is a write handle returned after an event is executed.
Field | Type |
---|---|
eventUri | RaptureURI |
eventId | String |
didRun | Boolean |
HttpEventApi eventApi = new HttpEventApi(loginApi);
boolean retVal = eventApi.eventExists(eventUri);
retVal = baseAPI.doEvent_EventExists(eventUri);
Entitlement: /event/admin
Determines whether an event has been defined.
Parameter | Type | Description |
---|---|---|
eventUri | String |
Type | Description |
---|---|
boolean |
HttpEventApi eventApi = new HttpEventApi(loginApi);
List<String> retVal = eventApi.deleteEventsByUriPrefix(uriPrefix);
retVal = baseAPI.doEvent_DeleteEventsByUriPrefix(uriPrefix);
Entitlement: /data/write/$f(uriPrefix)
Removes a folder and its contents recursively, including empty subfolders. Validates entitlement on individual events and folders. Returns a list of the events and folders removed.
Parameter | Type | Description |
---|---|---|
uriPrefix | String |
Type | Description |
---|---|
List |