Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
5 subscribers
Views
2029 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Hi All, I am creating a plugin to get all portal alerts for a process based on p
Chitra Sharma
over 8 years ago
Hi All, I am creating a plugin to get all portal alerts for a process based on process ID. It is returning expected result while testing with test process model. However when integrate with some running application, it does not retrieve alert details.
Appreciate any suggestions. Thanks in advance!
OriginalPostID-226103
OriginalPostID-226103
Discussion posts and replies are publicly visible
0
Tom Ryan
Appian Employee
over 8 years ago
I think you will need to add some more details. What approach are you using to retrieve alerts? Are you seeing any errors? Are you using the correct inputs for the running process?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chitra Sharma
over 8 years ago
Below is my code snippet-
ServiceContext sc = ServiceContextFactory.getAdministratorServiceContext();
this.portalNotificationService = ServiceLocator.getPortalNotificationService(sc);
ResultPage rp = this.portalNotificationService.getNotificationsPaging(startIndex, Constants.COUNT_ALL, Notification.SORT_BY_TIMESTAMP, Constants.SORT_ORDER_DESCENDING);
Notification[] notifications = (Notification[])rp.getResults();
I am running loop on notifications and get the attributes(processName, taskName) of each notification. Notifications array fetches all the alerts that is created by test model by does not retrieve the running application.
No error thrown while execution.
Appian version i am using is 16.1
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chitra Sharma
over 8 years ago
I can get alerts for process model whose "Alerts" settings is "Use system defaults for error alerts." But unable to retrieve alerts generated with "Use custom error alert settings.".
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tom Ryan
Appian Employee
over 8 years ago
Most likely your custom alert settings are not sending any alerts to the default Administrator account, so you are getting an empty ResultPage. Since you are using the Administrator ServiceContext, you would either need to include the Administrator account in the custom alert settings, or use the ServiceContext of a user that would be receiving the alerts.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chitra Sharma
over 8 years ago
Many Thanks! It works with User ServiceContext!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel