Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

2409

August 9th, 2017 20:00

Smarts java api to access ics-notification

I have a program that uses rest-api interface for ICS_Notification, taking class-name, instance-name and event-name and issue calls to update attributes (ie: trouble-ticket-id) and acknowledge a notification. From all the samples and tips shared by members within this forum, that was straight forward.

We would like to develop a similar functionalities but using Smarts Java API instead. I have been looking at java api docs and it is not as intuitive as rest api calls.

Can someone assist by providing suggestions/tips or point to sample code that perform update and action (such as acknowledge or takeOwnership) of a notification using Smarts Java API?

Thank you.

21 Posts

August 14th, 2017 04:00

Hi James - looks like you've already found the key:

"... By using SmRemoteDomainManager.invokeOperation() and passing in  proper values (following closely to dmctl), to trigger corresponding method of an ics-notification. ..."

The Smarts API provides much the same as dmctl - get, put, findInstance, invokeOperation etc. The API has no knowledge of the classes contained in a domain manager (it is generic across all domain managers). The one thing that you need to be aware of is that the API differs from dmctl in that you have to call invokeOperation( , ,'changed', []) to make the results of any 'put' calls permanent.

- Peter

21 Posts

August 10th, 2017 05:00

54 Posts

August 10th, 2017 14:00

James,

Did the link that Peter provide assist you in resolving your question?

3 Posts

August 11th, 2017 08:00

Hello.

Not really. I have read that remote api doc twice before posting on this forum (ok, excluding the c++ section.) Something with this java api is not clicking with me.

Establishing a connection using SmRemoteDomainManager (or SmRestartableDomainManager) was straightforward.

My input is fed from an external system that provides class-name, event-name, instance-name so I am not subscribing on Smarts side. I suspect I'd need to search and locate reference to the notification, ie: calling findInstances() using class-name and instance-name, then loop it to fetch and filter out by event-name.

After obtaining the reference, there will be more calls needed to perform equivalent of takeOwnership/acknowledge of an ICS_Notification. That part remain unclear clear to me.

Even the remote api doc discussed ICS_Notification and the methods, however, I did not find such java class within the java api doc and that has caused the confusions. Just guessing away at this, I suspect there is no such class and methods. Using takeOwnership as an example (can be easily done via the portal or via rest-api call), java-api wise, one would need to know all the attributes it modified behind the scene, and update those attribute(s) accordingly. still piecing things together...

Or perhaps all that is not necessary. By using SmRemoteDomainManager.invokeOperation() and passing in  proper values (following closely to dmctl), to trigger corresponding method of an ics-notification. This is still on the my list to investigate.

anyway, I'm continue to grind away at it until figured something out. But if someone familiar with this (java-api and invoking functions offered by ics-notification) can shed a light in this area, that would b greatly appreciated.

Thanks.

3 Posts

August 18th, 2017 09:00

That started as a hunch and your comments put me on the right path.

Thank you !!

No Events found!

Top