Created
July 26, 2023 14:56
-
-
Save NithinMahesh1/d8516dc2eaad08029d8c664d8450b66b to your computer and use it in GitHub Desktop.
Custom Event Handler Retrieval Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Item relationships = this.getRelationships(); | |
int eventItemsCount = relationships.getItemCount(); | |
/* for each event in this batch, get the event details and perform | |
custom publishing logic */ | |
for (int i = 0; i < eventItemsCount; i++) { | |
Item eventItem = relationships.getItemByIndex(i); | |
var data = eventItem.node.SelectNodes("./data"); | |
string dataXml = string.Empty; | |
if (data.Count > 0) { | |
dataXml = data[0].InnerXml; | |
} | |
string subject = eventItem.getProperty("subject", string.Empty); | |
string type = eventItem.getProperty("type", string.Empty); | |
string eventId = eventItem.getProperty("id", string.Empty); | |
string time = eventItem.getProperty("time", string.Empty); | |
string source = eventItem.getProperty("source", string.Empty); | |
// add your publishing logic here | |
} | |
return this; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment