when you create a headless client with code like this:
- Code: Select all
// Creates a headless client that will open the given solution.
var headlessClient = plugins.headlessclient.createClient("someSolution", "user", "pass", null);
if (headlessClient != null && headlessClient.isValid()) {
var x = new Object();
x.name = 'remote1';
x.number = 10;
headlessClient.queueMethod(null, "remoteMethod", [x], callback);
}
Does the solution than also fires the onSolutionOpen method?
I'm asking this, because I have one solution, that is working as a batchprocessor (= headlessclient) and I want to use it for offloading work to the server. (= also headless client)
The reason that it is one solution, is that I need 90% of the methods in both situations.
But in case of creating the headless client in code, I don't want the onSolutionOpen to fire, because there are cronjobs scheduled, that I don't want.
I can't also check in the onSolutionOpen if it is batchprocessor or headless-client, because there is only one Constant: APPLICATION_TYPES.HEADLESS_CLIENT
Anyone have an idea?