Send Message using Notification service  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Send Message using Notification service

Postby SBarnes » Mon Feb 24, 2020 2:50 pm

How can you send a message using Jiwa's notification service to a user, from inside a windows service?

Take for granted that Jiwa is logged on an a manager exists.
Regards
Stuart Barnes
stuart@attkey.com.au
SBarnes
Jiwa Sensei
Jiwa Sensei
 
Posts: 856
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 74

Re: Send Message using Notification service

Postby Scott.Pearce » Mon Feb 24, 2020 3:04 pm

Use the JiwaFinancials.Jiwa.JiwaToDos.ToDo business logic to construct and save a "ToDo" (i.e. set properties such as subject, message, assigned by, assigned to, etc.). Make sure that the ReminderSpecificDateTime property is set to now or in the past, and the ReminderType property is set to "Specific".

Saving this object puts an entry into TD_Main. Jiwa.exe polls this table for unread messages every n seconds where n is defined in the system setting System->ToDoPollInterval.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Jiwa Senpai
Jiwa Senpai
 
Posts: 580
Joined: Tue Feb 12, 2008 11:27 am
Location: North Sydney, New South Wales
Topics Solved: 172

Re: Send Message using Notification service

Postby SBarnes » Mon Feb 24, 2020 3:17 pm

Ok that looks fairly easy, is there a way that you can put in a hyperlink to drill from the todo to a general journal set, sort of like linked documents or business objects?

I think I already know the answer is going to be no but I thought it was worth asking.
Regards
Stuart Barnes
stuart@attkey.com.au
SBarnes
Jiwa Sensei
Jiwa Sensei
 
Posts: 856
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 74

Re: Send Message using Notification service

Postby Scott.Pearce » Mon Feb 24, 2020 4:00 pm

The ToDo body is HTML, so you can insert text like:

Code: Select all
<A id=0000000008000000001B
href="jiwa:JiwaFinancials.Jiwa.JiwaJournalSetsUI.MainForm,0000000008000000001B">Journal
Set 100007</A>


into the body text. Use the ToDo Maintenance form to create links, then right click and "view source", then copy-paste the anchor tag.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Jiwa Senpai
Jiwa Senpai
 
Posts: 580
Joined: Tue Feb 12, 2008 11:27 am
Location: North Sydney, New South Wales
Topics Solved: 172

Re: Send Message using Notification service

Postby SBarnes » Mon Feb 24, 2020 5:42 pm

Scott you are a genius, thanks.
Regards
Stuart Barnes
stuart@attkey.com.au
SBarnes
Jiwa Sensei
Jiwa Sensei
 
Posts: 856
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 74

Re: Send Message using Notification service

Postby SBarnes » Tue Feb 25, 2020 7:01 pm

Hi Scott

It goes in as a hyper line but when you click on it you get a message about web page can not be displayed, below is an example of what is being put in the body, any idea of what I am doing wrong?


<A id=b9071863d42b4a949e2d href = "jiwa:JiwaFinancials.Jiwa.JiwaJournalSetsUI.MainForm, b9071863d42b4a949e2d"> Journal Set 102657</A>
Regards
Stuart Barnes
stuart@attkey.com.au
SBarnes
Jiwa Sensei
Jiwa Sensei
 
Posts: 856
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 74

Re: Send Message using Notification service

Postby Mike.Sheen » Tue Feb 25, 2020 9:11 pm

Hi Stuart,

The experience you get with this depends on which version of Jiwa you are using.

In 7.2.1 we changed the way of drilling down to TODO links - we used to use what's known as an asynchronous pluggable protocol (aka shell links) - which just meant that when you installed Jiwa, we added a registry entry such that links starting with jiwa: would be recognised by browsers and invoke Jiwa.exe with the URL information and launch Jiwa.exe, passing in the URL as an argument and Jiwa.exe would look to see if another Jiwa.exe was running and if so, invoke a method via a socket which knew what to do with the URL.

This had many shortcomings (like what if Jiwa was running, but connected to a different database - see DEV-7189), so we decided to remove that way of drilling down in DEV-7611 as part of 7.2.1. We now don't rely on the asynchronous pluggable protocol (shell link) and instead parse the URL ourselves and load up the form just like you would normally do within Jiwa.

I think what might be happening for you is your system still has the registry entries we wanted to remove which handle drilling down using a shell link.

Can you check to see if you still have the registry entries described in DEV-7611 ? If you do still have them, remove them and try again - if that works then we obviously failed to remove those registry entries as we intended, and you should log an issue for that. If it still doesn't work, then we'll need to know where the hyperlink is failing (there are a few places which handle TODO links - is it the TODO desktop notification, listing form or TODO maintenance form) and with that information we can test and try to repro the issue.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Jiwa Shihan
Jiwa Shihan
 
Posts: 1678
Joined: Tue Feb 12, 2008 11:12 am
Location: North Sydney
Topics Solved: 523

Re: Send Message using Notification service

Postby Mike.Sheen » Tue Feb 25, 2020 9:40 pm

After inspecting the code, I think we messed up here.

The links work when clicked on the TODO listing form, but not the TODO maintenance form. The new drill-down logic (handling the NavigatingTo event of the web browser control) doesn't seem to be present in the todo maintenance form.

I cannot look at this right now or tomorrow - I'm currently helping a customer with some emergency disaster recovery work - perhaps Scott (he'll see this tomorrow) can take over.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Jiwa Shihan
Jiwa Shihan
 
Posts: 1678
Joined: Tue Feb 12, 2008 11:12 am
Location: North Sydney
Topics Solved: 523

Re: Send Message using Notification service

Postby SBarnes » Tue Feb 25, 2020 9:50 pm

Looks like the registry entries aren't there.

By the way I've also reported a bug https://service.jiwa.com.au/servicedesk ... /JIWA-5879 I discovered basically you can't delete a pending journal with a note attached as you get a foreign key violation.

Do you you think this the hyperlink is solvable with a plugin, as I'd be willing to have a go if you point me to where to look at how it works in the to do list screen?
Regards
Stuart Barnes
stuart@attkey.com.au
SBarnes
Jiwa Sensei
Jiwa Sensei
 
Posts: 856
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 74

Re: Send Message using Notification service

Postby Mike.Sheen » Tue Feb 25, 2020 9:58 pm

SBarnes wrote:Looks like the registry entries aren't there.
Do you you think this the hyperlink is solvable with a plugin, as I'd be willing to have a go if you point me to where to look at how it works in the to do list screen?


Our handler which works looks like this:

Code: Select all
Private Sub WebBrowser_Navigating(sender As Object, e As WebBrowserNavigatingEventArgs)
   If e.Url.ToString().StartsWith("jiwa:") Then
      e.Cancel = True
      Dim urlComponents As String() = e.Url.ToString().Split(",")
      Dim jiwaForm As JiwaApplication.IJiwaForm = Manager.FormFactory.CreateForm(Strings.Mid(urlComponents(0), 6))
      jiwaForm.DrillDownID = urlComponents(1)
      jiwaForm.Start()
   End If
End Sub


In the Todo maintenance form, the control is named ExtendedWebBrowser1 - so in theory adding a handler to ExtendedWebBrowser1.Navigating would do what you need.


SBarnes wrote:By the way I've also reported a bug https://service.jiwa.com.au/servicedesk ... /JIWA-5879 I discovered basically you can't delete a pending journal with a note attached as you get a foreign key violation.


That's not currently in our queue - waiting on support to triage and I am unable to intervene presently. That was only lodged at 7:06pm today, and I've already mentioned I'm tied up helping a customer with an emergency - so I need to leave that to the rest of the team to deal with - I'm sure they'll get back to you soon.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Jiwa Shihan
Jiwa Shihan
 
Posts: 1678
Joined: Tue Feb 12, 2008 11:12 am
Location: North Sydney
Topics Solved: 523

Next

Return to Technical / Programming

Who is online

Users browsing this forum: SBarnes and 1 guest