Jiwa Plugin Scheduler Service not doing anything

Discussions relating to plugin development, and the Jiwa API.

Jiwa Plugin Scheduler Service not doing anything

Postby DannyC » Thu Jan 24, 2019 4:37 pm

Hi,
I have the Jiwa Plugin Scheduler Service running & a few plugins have schedules entered to fire on given timing - one is every xx minutes.

When looking in Event Viewer, I can see that the service has started but it's not doing anything.
Is there a way to set the service to verbose mode or other way to rummage about to find why it's not firing the scheduled plugins? Everything is enabled (i.e the plugin, plus the schedule within) and the config file is correctly configured with the database name, server name etc.

version 7.2.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Jiwa Plugin Scheduler Service not doing anything

Postby Mike.Sheen » Fri Jan 25, 2019 9:38 am

Hi Danny,

Add some event logging to various points to see what's happening.

If you don't have some code to do that - below is a method you can put in your class:
Code: Select all
Public Sub LogToEventLog(ByVal Message As String, ByVal EventLogEntryType As System.Diagnostics.EventLogEntryType)
   Dim Log As New System.Diagnostics.EventLog("Application")
   Log.Source = "Jiwa 7"
   Log.WriteEntry(Message, EventLogEntryType)
   Log.Close()
End Sub


Then the usage of this:
Code: Select all
LogToEventLog("Checkpoint #1", System.Diagnostics.EventLogEntryType.SuccessAudit)


I'd start with the Execute method of the ScheduledExecutionPlugin class - put a log entry there and see if it appears in the application log.
If it doesn't, then your plugin is not being executed - ensure it is enabled and try removing and re-adding the schedule.
Don't forget you'll need to restart the service after any changes to your plugin.

Mike
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
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Jiwa Plugin Scheduler Service not doing anything

Postby DannyC » Fri Jan 25, 2019 1:33 pm

The very first line of the Execute method is
Code: Select all
Plugin.Manager.LogEvent("Starting Batch Sales Order Process Run", EventLogEntryType.Information , 101, 1);


I have deleted the schedule & recreated.

I still don't get anything firing.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Jiwa Plugin Scheduler Service not doing anything

Postby Mike.Sheen » Fri Jan 25, 2019 1:48 pm

Can you try logging not using Plugin.Manager.LogEvent and instead use the method provided.

The reason is that Plugin.Manager.LogEvent rather rudely swallows any exceptions occurring when attempting to log to the event log. Using the method I provided in my previous post will reveal if there is a problem writing to the event log.

Oh - and Plugin.Manager.LogEvent will only log anything if the system setting LogApplicationEvents is on.
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
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Jiwa Plugin Scheduler Service not doing anything

Postby DannyC » Fri Jan 25, 2019 2:36 pm

Thanks. Have added in your code.
I can confirm that it isn't firing. Nothing written into the event log.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Jiwa Plugin Scheduler Service not doing anything

Postby Mike.Sheen » Fri Jan 25, 2019 2:39 pm

What about if you put a log entry in the OnServiceStart method and then restart the service?
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
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Jiwa Plugin Scheduler Service not doing anything

Postby DannyC » Fri Jan 25, 2019 3:10 pm

adding
LogToEventLog("Checkpoint #1", System.Diagnostics.EventLogEntryType.SuccessAudit);
in the OnServiceStart method is not firing either. Nothing in the event log.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Jiwa Plugin Scheduler Service not doing anything

Postby Mike.Sheen » Fri Jan 25, 2019 3:11 pm

DannyC wrote:adding
LogToEventLog("Checkpoint #1", System.Diagnostics.EventLogEntryType.SuccessAudit);
in the OnServiceStart method is not firing either. Nothing in the event log.


Then either your plugin is not enabled, or it's in a different database to what the service is configured for.

EDIT: Also verify the PluginsToExclude and PluginsToInclude in the service config file - they affect which plugins to ignore.
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
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Jiwa Plugin Scheduler Service not doing anything

Postby DannyC » Fri Jan 25, 2019 3:56 pm

And therein lies the challenge. I can 100% confirm the plugin is enabled, and the schedule within that plugin is also enabled.

I can also confirm the config file is correct & pointing at the appropriate database.
I don't have any entries in PluginsToExclude/PluginsToInclude.
User avatar
DannyC
Senpai
Senpai
 
Posts: 638
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Jiwa Plugin Scheduler Service not doing anything

Postby Scott.Pearce » Fri Jan 25, 2019 4:28 pm

Try this:

1. Create a fresh demo database on the same server
2. Disable all plugins in the database
3. Import the attached plugin and ensure it is enabled
4. Re-point the scheduler service to your fresh demo database
5. Start the plugin scheduler service

You should see this in the event log (each line is it's own event):

Code: Select all
[JiwaPluginSchedulerService, Version=7.2.0.0, Culture=neutral, PublicKeyToken=e30ce81e37f29c8c], [JiwaFinancials.Jiwa.JiwaPluginSchedulerService.JiwaPluginSchedulerService].[ServiceStart]Establishing Connection for: JiwaDemo (SessionID: 30861bc8-330b-46b6-8437-63502caf7837)


Code: Select all
Checkpoint #1 - Service Started


Code: Select all
Checkpoint #2 - Plugin executed.


Code: Select all
Service started successfully.



Then every minute thereafter you should see a new event appear:

Code: Select all
Checkpoint #2 - Plugin executed.
Attachments
Plugin Scheduler Test.xml
(33.06 KiB) Downloaded 64 times
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 743
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 13 guests