Include and exclude plugins like the scheduled service

Discussions relating to plugin development, and the Jiwa API.

Include and exclude plugins like the scheduled service

Postby SBarnes » Mon Nov 25, 2019 5:32 pm

The scheduled service provides the ability to include and exclude specified plugins, is there a way to do this for a standalone application that might log into Jiwa?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Include and exclude plugins like the scheduled service

Postby Mike.Sheen » Mon Nov 25, 2019 9:56 pm

SBarnes wrote:The scheduled service provides the ability to include and exclude specified plugins, is there a way to do this for a standalone application that might log into Jiwa?


That functionality is only for including or excluding plugins which are invoked by a schedule. It doesn't stop any plugins from being compiled (if needed) or loaded - it just limits which plugins are executed on a scheduled basis. Even excluded plugins are still compiled (if needed) and loaded by the Plugin Scheduler Service.

You would open a nightmare of potential problems by excluding plugins from being loaded into the appdomain selectively.

What are you hoping to achieve with selectively excluding plugins from being loaded?
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: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Include and exclude plugins like the scheduled service

Postby SBarnes » Tue Nov 26, 2019 6:28 am

Hi Mike,

I understand your point of if something is attaching to the business logic then it should be there regardless and enforce the rules.

The situation I am trying to overcome is where there is a plugin that executes code every time an order is saved.

Depending on the source of the order, namely the program that put the order into Jiwa there are certain sources where this plugin code shouldn't fire.

At the moment the only way I can see that being made to happen is either setting a flag through the sales orders generic object list or using a custom field as a flag. Either of these options however will "couple" one plugin/program knowing about the other.

What I would prefer to do is by configuration rather than code stop the second plugin from firing that way if conditions change and it is required to fire it's simply a change to the configuration and not the code that would be needed and thus the solution won't have different parts tied together unnecessarily i.e. I am trying to loosely couple this together but I don't think its possible.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Include and exclude plugins like the scheduled service

Postby Mike.Sheen » Tue Nov 26, 2019 6:35 pm

Ok, so I see the use case now.

You're probably aware of Assembly.GetExecutingAssembly().Location which you could use inside plugins to determine the .exe name and folder the plugin got invoked from - you can use that inside plugins to make decisions about what code paths to take.

The problem then is if you don't "own" the plugin you want to alter the behaviour for, as changing the code in other authors plugins is fraught with danger - most obviously it might get updated at some point and your code changes lost. You also don't want to be the one left holding any liability if something goes wrong relating to that plugin and you were the last to touch it.

This is also difficult for us to build in something natively which suits all scenarios. We could add a couple of simple properties to the Manager object which are just lists of plugin names or ID's to exclude or include, which you as a 3rd party developer could add to after instantiating the Manager - but the scenarios that doesn't quite fit is when you want to exclude some of the logic, not all, from a particular plugin from executing.

What do you think about the concept of two list properties - an inclusion list and exclusion list - that you would need to explicitly add to after instantiating a Manager?
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: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Include and exclude plugins like the scheduled service

Postby SBarnes » Wed Nov 27, 2019 6:29 am

Hi Mike,

Yes that would work if the following were possible also?

1. The lists worked same as the scheduled plugin service lists works, i.e. if the inclusion list contains entries and the exclusion list is empty only the inclusions list fires

2. If as you have describe there was the ability to interrogate the manager to get a list of plugins would probably be needed.

This is a further suggestion and might make this useful but it would be handy if if you could also get the type such as form plugins or business logic plugins etc, I don't know if here some sort of lambda expression or function as a parameter could be done so that something like I only want plugins to execute that were created by Jiwa to fire could work i.e interrogate to get the list and then hand it back in. This could also be a handy way for a plugin being able to tell if another plugin was present and enabled under other circumstances also.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Include and exclude plugins like the scheduled service

Postby SBarnes » Mon Dec 02, 2019 4:51 pm

Could the web api also support the same functionality as the scheduled plugin service that way is a similar way it could support different functionality fro different sources?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 5 guests