Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Super Contributor.. davros29 Super Contributor..
Super Contributor..
414 views

Raise TRIM error notification

Jump to solution

When TRIM runs into an error (e.g. SQL timeout/error, attempted login by a locked account etc) it sends an error email to the account specified in the Email Notifications tab in the Enterprise Studio options dialog.

Is there a way to raise one of these errors through the SDK? 

 

0 Likes
1 Solution

Accepted Solutions
Super Contributor.. davros29 Super Contributor..
Super Contributor..

Re: Raise TRIM error notification

Jump to solution

Thanks for your suggestions, @rkw, @JanMartin and @David Churchland. I wrote that question quickly and have been away for a while, so apologies for replying to an old thread. 

There's a class called HP.HPTRIM.SDK.TrimException that I thought I might be able to use to kick off one of these emails, but I think I was overthinking it.

The way to do this ended up being embarrassingly simple. I just needed to re-throw the exception in the catch block. So I added throw; and eventually it bubbles up to where it must be handled by TRIM and sends one of these standard error emails. The code is in a Custom Event processor and I just wanted to send an email to the admins if it ran into an issue. I was worried about the event process getting into a "Blocked by error" state but that doesn't seem to happen when it throws an error for a custom processor. Thanks for your help.

0 Likes
4 Replies
Micro Focus Expert
Micro Focus Expert

Re: Raise TRIM error notification

Jump to solution

I have never seen anything in the SDK to explicitly send one of these emails.

The SDK operates on data stored in the database but the email notification information (as updated in Enterprise Studio) is stored in an XML file on the workgroup server.  I do not see how the SDK could access it.  


Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
0 Likes
Highlighted
JanMartin Outstanding Contributor.
Outstanding Contributor.

Re: Raise TRIM error notification

Jump to solution

Are you trying to specifically trigger an existing TRIM error, or do you just want to send your own message?

You could use Email Templates and piggy back off of another event to send your own custom message - have a look at Email Templates to see the events you can trigger emails for.

I've never tried them, but maybe "Alerts" would do what you want?

0 Likes
Regular Contributor.. rkw Regular Contributor..
Regular Contributor..

Re: Raise TRIM error notification

Jump to solution

Maybe an overkill - Via the SDK you could extend the TrimEventProcessorAddIn and catch any specific events you wish to handle.

 

public override void ProcessEvent(Database db, TrimEvent evt)
{
switch (evt.EventType)
{
case Events.UserLogoff:
case Events.UserLogon:
case Events.UserLogonFailed:
case Events.NewInstantOnUser:
//Do Something
default:
//Do Something
break;
}
}

0 Likes
Super Contributor.. davros29 Super Contributor..
Super Contributor..

Re: Raise TRIM error notification

Jump to solution

Thanks for your suggestions, @rkw, @JanMartin and @David Churchland. I wrote that question quickly and have been away for a while, so apologies for replying to an old thread. 

There's a class called HP.HPTRIM.SDK.TrimException that I thought I might be able to use to kick off one of these emails, but I think I was overthinking it.

The way to do this ended up being embarrassingly simple. I just needed to re-throw the exception in the catch block. So I added throw; and eventually it bubbles up to where it must be handled by TRIM and sends one of these standard error emails. The code is in a Custom Event processor and I just wanted to send an email to the admins if it ran into an issue. I was worried about the event process getting into a "Blocked by error" state but that doesn't seem to happen when it throws an error for a custom processor. Thanks for your help.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.