Help with Plugin with Schedule  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Help with Plugin with Schedule

Postby marcosomizu » Mon Feb 15, 2016 5:48 pm

Hi,

I have created a plugin responsible for doing things that should be scheduled.

The code behind the plugin works fine. The problem is, even scheduling the plugin, nothing happens after minutes.

I am putting my plugin attached, and here is my JiwaPluginSchedulerService.exe.config:

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="Settings" type="JiwaFinancials.Jiwa.JiwaPluginSchedulerService.Configuration.ConfigurationHandler,JiwaPluginSchedulerService" />
  </configSections>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
    </startup>
  <Settings>
    <PollInterval>60000</PollInterval>
    <Databases>
      <Database>
        <DatabaseName>FPTest</DatabaseName>
        <ServerName>GREG-HP\SQLEXPRESS</ServerName>
        <JiwaUsername>Admin</JiwaUsername>
        <JiwaPassword>password</JiwaPassword>
      </Database>
    </Databases>
  </Settings>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
                <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>


PS: The Stored Procedure doesn't do nothing special, it just gets all the parameters from the database.

Could someone help me with this?

Cheers
Attachments
Plugin FP Invoice - Bulk email out.xml
(39.08 KiB) Downloaded 481 times
marcosomizu
Occasional Contributor
Occasional Contributor
 
Posts: 23
Joined: Mon Sep 07, 2015 12:01 pm
Topics Solved: 1

Re: Help with Plugin with Schedule  Topic is solved

Postby Mike.Sheen » Fri Feb 19, 2016 9:32 pm

Add some logging to the event log in your plugin code to see if anything is being executed.

Take a look at the "File Watcher" plugin to see how to log to the event log, and put some logging in the service start and execute events.

Wrap your service start and execute in a try catch, and log to the event log inside the catch the exception message.

Try configuring the service to run as a user account to see if it behaves different. Some actions can't be performed by non-user accounts (such as display interactions such as message boxes or form dialog displays), so this may be the the cause.

Let us know the outcome!

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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Help with Plugin with Schedule

Postby marcosomizu » Thu Feb 25, 2016 12:49 pm

Hi Mike,

After a few debugging and logging I was able to do what I wanted. I appreciate your help.

What I've noticed though is that I could only "fire" the Execute event in a Windows Server desktop, but not my computer (Win7). Once I start the scheduler, it stays with the "Started" status, but it doesn't change to "Running", whereas when I updated the plugin in a Windows Server, it ran normally. Does it makes sense or it is just a misinterpretation?

Cheers
marcosomizu
Occasional Contributor
Occasional Contributor
 
Posts: 23
Joined: Mon Sep 07, 2015 12:01 pm
Topics Solved: 1


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 6 guests