Qorus Integration Engine®  4.0.3.p1_git
Development Extension Modules

Development extension modules can be made to support multiple interface types in the same module; so for example a single development extension module can support workflows, services, and develmodules_job_modules "jobs".

In such cases, injected system APIs for other interface types are non-functional; so for example if a development extension module supports all interface types and is used in a workflow, in that case any access to injected job or service APIs will result in undefined behavior.

Note
Do not access non-contextual injected interface APIs; only use APIs according to the current interface context.

Workflow Extension Modules

The Workflow Modules Parameter workflow option allows user modules to provide new base classes for class-based workflow steps to allow reusable base classes for steps to be delivered along with Qorus.

Workflow modules have the class-based workflow API injected into them when loaded in order to allow them to extend these classes and provide reusable high-level functionality to Qorus workflows.

To use base classes provided by a workflow module as the base class of a class-based step, use the workflow-modules option in your workflow definition.

The following is an example workflow module providing a subclass for the QorusNormalStep class:

Workflow Module Example
# -*- mode: qore; indent-tabs-mode: nil -*-
# @file ExampleWorkflowModule.qm Qorus Integration Engine(R) example workflow module
%requires qore >= 0.9
%new-style
%require-types
%strict-args
%enable-all-warnings
module ExampleWorkflowModule {
version = "1.0";
desc = "workflow dev extension example module";
author = "Qore Technologies <info@qoretechnologies.com>";
url = "http://www.qoretechnologies.com";
}
public namespace ExampleWorkflowModule {
# this class defines a primary() method and requires subclasses to define a primaryImpl() method
public class ExampleNormalStep inherits QorusNormalStep {
final primary() {
log(LL_INFO, "running %s::primary()", self.className());
primaryImpl();
}
abstract primaryImpl();
}
}

Service Extension Modules

The Service Modules Parameter option allows user modules to provide new base classes for class-based services to allow reusable base classes for services to be delivered along with Qorus.

Service modules have the class-based service API injected into them when loaded in order to allow them to extend these classes and provide reusable high-level functionality to Qorus services.

To use base classes provided by a service module as the base class of a class-based service, use the service-modules option in your service definition.

The following is an example service module:

Service Module Example
# -*- mode: qore; indent-tabs-mode: nil -*-
# @file ExampleServiceModule.qm Qorus Integration Engine example module
%requires qore >= 0.9
%new-style
%require-types
%strict-args
%enable-all-warnings
module ExampleServiceModule {
version = "1.0";
desc = "service dev extension example module";
author = "Qore Technologies <info@qoretechnologies.com>";
url = "http://www.qoretechnologies.com";
}
public namespace ExampleServiceModule {
public class ExampleServiceModule inherits QorusService {
# name: example
# desc: method defined in the ExampleServiceModule module
string example() {
return exampleImpl();
}
# this method must be defined in child classes
abstract string exampleImpl();
}
}

Job Extension Modules

The Job Modules Parameter option allows user modules to provide new base classes for class-based jobs to allow reusable base classes for jobs to be delivered along with Qorus.

Job modules have the class-based job API injected into them when loaded in order to allow them to extend these classes and provide reusable high-level functionality to Qorus jobs.

To use base classes provided by a job module as the base class of a class-based job, use the job-modules option in your job definition.

The following is an example job module:

Job Module Example
# -*- mode: qore; indent-tabs-mode: nil -*-
# @file ExampleJobModule.qm Qorus Integration Engine example module
%requires qore >= 0.9
%new-style
%require-types
%strict-args
%enable-all-warnings
module ExampleJobModule {
version = "1.0";
desc = "Job dev extension example module";
author = "Qore Technologies <info@qoretechnologies.com>";
url = "http://www.qoretechnologies.com";
}
public namespace ExampleJobModule {
public class ExampleJobModule inherits QorusJob {
final run() {
log(LL_INFO, "run method here");
runImpl();
}
# this method must be defined in child classes
abstract runImpl();
}
}