Qorus Integration Engine®  5.1.2_git
Qore-Language Development Extension Modules

Qore-language 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.

Qore-Language Workflow Extension Modules

The workflow modules workflow option allows user modules to provide new base classes for step classes 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 step class, 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 = "https://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() {
logInfo("running %s::primary()", self.className());
primaryImpl();
}
abstract primaryImpl();
}
}

Qore-Language Service Extension Modules

The service-modules option allows user modules to provide new base classes for service classes 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 service class, 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 = "https://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();
}
}

Qore-Language Job Extension Modules

The Job Modules option allows user modules to provide new base classes for the job logic 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 job class, 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 = "https://www.qoretechnologies.com";
}
public namespace ExampleJobModule {
public class ExampleJobModule inherits QorusJob {
final run() {
logInfo("run method here");
runImpl();
}
# this method must be defined in child classes
abstract runImpl();
}
}