File Service.lua
Functions
Service:cleanup (status, message) | Perform finale... |
Service:new (t) | New instance constructor. |
Service:newClass (t) | Constructor for extending class. |
Service:perform (context, ...) | Initiate and perform main service function, excluding the finale. |
Service:setMandatoryMessage (f, ...) | Register a mandatory message to be displayed in final dialog box. |
Service:skipFinalDialogIfOk () | Call at any time (or set flag upon construction). |
Functions
- Service:cleanup (status, message)
-
Perform finale...
See Call parent class for more info.
Parameters:
-
status
: boolean: true iff execution completed without an error being thrown. -
message
: string: error message corresponding to error if thrown.
-
- Service:new (t)
-
New instance constructor.
Parameters:
-
t
: Parameter table whose elements are:- name: (string, required)
- object: (table) instance of class with main and finale methods - optional.
- main: (function, required)
- async: (boolean, default false) true => asynchronous, false => synchronous.
- progress: (boolean or string, default false) true => default progress scope, string => scope with custom title, false => set scope to nil.
- finale: (function, default nil) executed after main if provided, regardless of whether main errors out.
- guard: (number, default zero) nil or zero => reentrant, App.guardSilent => silent, App.guardVocal => vocal.
- name: (string, required)
Usage:
see Call class for more info.
Return value:
- service object suitable for passing to app:call method.
-
- Service:newClass (t)
-
Constructor for extending class.
Parameters:
-
t
:
-
- Service:perform (context, ...)
-
Initiate and perform main service function, excluding the finale.
See Call parent class for more info.
Parameters:
-
context
: function-context, in case you need to create a property table, hopefully thats the only use for it... -
...
: Passed to main.
-
- Service:setMandatoryMessage (f, ...)
-
Register a mandatory message to be displayed in final dialog box. Note: this assures final dialog box is displayed (overriding action-pref-key, and regardless of warning/error statuses).
Parameters:
-
f
: -
...
:
-
- Service:skipFinalDialogIfOk ()
- Call at any time (or set flag upon construction).