Opening an external App from Jiwa 7 using plugins

Samples and Examples of using the Jiwa 7 framework - including plugins, stand-alone applications and scripts.

Opening an external App from Jiwa 7 using plugins

Postby Mike.Sheen » Fri Jan 31, 2014 10:50 am

Here's a brief guide on how to make a plugin to open an external application when a Jiwa 7 menu option is launched.

Firstly, we need to create a new plugin. From the plugin maintenance form, select the New record tool.

Don't modify the existing code, just scroll right to the bottom of the existing code and paste the following code in

Code: Select all
Partial Class LaunchApp       
   Inherits JiwaFinancials.Jiwa.JiwaApplication.ProcessAction.UserInterface
         
   Public Sub New()
       Dim notepad As System.Diagnostics.Process = System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo("notepad.exe"))         
   End Sub
            
   Public Overrides Sub Start()
         
    End Sub
   
End Class


Enter in a plugin name and description, check the enabled checkbox.

The form should like this :

1CreatePlugin.PNG
Creating a new plugin


Save the new plugin and now open the Forms maintenance form. In here we need to define a new form, linking it to the newly created plugin.

At the bottom "template" row of the forms grid, select the Form Type combo box and select plugin.

2FormsMaint.PNG
Adding a new form of type plugin


Then choose the Assembly using the lookup button next to the Assembly Full Name column. Because we used a type of Plugin, and not Form - the Assembly lookup button loads a search window prompting us to choose which plugin to use.

3FormsMaint.PNG
Selecting the plugin


Choose the new plugin, and then in the class name drop down, choose the "LaunchApp" class from the list. Give the form a description of "Launch App" and then save.

31FormsMaint2.PNG
New form entry
31FormsMaint2.PNG (4.42 KiB) Viewed 1060 times


Now we have defined a form, we need to add it to a menu. Open the menu maintenance form and locate the "Launch App" form from the list, and drag onto the menu. In this case we want to add it to the "Samples" folder under the Plugins folder.

4MenuMaint.PNG
Adding the new form to the menu


Save and the menu will refresh. Test the new menu option by locating the "Launch App" menu option and selecting it. The notepad application should appear as follows:

5Test.PNG
Launching from the menu


If you want to pass arguments to the application being launched, this is possible - explore the .NET documentation on System.Diagnostics.Process to see how.
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

Return to Samples and Examples

Who is online

Users browsing this forum: No registered users and 1 guest