Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

Care must be taken if interacting with the User Interface within handlers of business logic objects added from the Setup method of the BusinessLogicPlugin class.

You must not assume there is a user to respond to or dismiss message boxes or dialogs - events may be raised from services such as the REST API which are using the business logic and have no user interface.

User interaction should be performed in the FormPlugin class, which is guaranteed a user interface - add the handlers to business logic events there, not in the BusinessLogicPlugin class.

ApplicationManagerPlugin class

This class has it’s Setup method invoked are part of the Logon process, after plugins have been compiled and loaded, and most logon operations completed.

The LoggedOn event is the last action of the logon process, and plugins can add a handler for that in the Setup method of the ApplicationManagerPlugin class:

Code Block
languagec#
public class ApplicationManagerPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaApplicationManagerPlugin
{
    public override object InitializeLifetimeService()
    {
        // returning null here will prevent the lease manager
        // from deleting the Object.
        return null;
    }

    public void Setup(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
    {
		Plugin.Manager.LoggedOn += delegate() 
			{ 
				// code to execute when logged on here
			};
    }
}

CustomFieldPlugin class

LineCustomFieldPlugin class

SystemSettingPlugin class

ScheduledExecutionPlugin class

This class has only relevance when the Jiwa Plugin Scheduler Service is configured and running.

It contains three methods:

Execute

This is executed for each schedule defined against the plugin, as they fall due. The template code has a lock semaphore in place to prevent pre-empting any already running execution.

Code Block
languagec#
public void Execute(JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin, JiwaFinancials.Jiwa.JiwaApplication.Schedule.Schedule Schedule)
    {
        lock (JiwaFinancials.Jiwa.JiwaApplication.Manager.CriticalSectionFlag)
        {
            // place processing code in here
        }
    }

OnServiceStart

This method is invoked when the service is starting.

It is often used to add handlers for the Windows File System to detect when a file appears in a folder (File Watcher) - note that no schedule is needed for such handlers.

OnServiceStopping

This method is invoked when the service is stopping.

Common Mistakes

Some of the more common mistakes which can cause significant issues are:

...