15,701 bytes added,
21 September = MRO Replication Jobs =
MRO replication jobs generate work packages from configured maintenance plans. The processing is divided into two steps: the Maintenance Planning Orchestrator schedules jobs for eligible maintenance plans, and a separate EnterpriseService executes the scheduled jobs.
This page describes the available MRO replication jobs, the required BasicClient App and EnterpriseService configuration, and a basic setup for testing or demonstrating MRO replication.
For the configuration and behaviour of maintenance plans, see [[MROMaintenancePlans]].
== Replication process ==
MRO replication uses the following process:
# The Maintenance Planning Orchestrator searches for maintenance plans that are ready for automatic work package generation.
# Each eligible maintenance plan provides the replication job required for its plan type.
# The orchestrator schedules the job in '''MRO_JOB_DISPATCHING'''.
# A separate EnterpriseService processes the scheduled job.
# The replication job uses the template work package and the linked '''INSTANCE_REPLICATION''' object to generate the work package.
Scheduling a job does not execute the replication immediately. It creates a dispatching job containing the information required for later execution.
For a basic test or demonstration, the scheduling and execution processes can be configured in two separate UBIK.Studio folders.
== Available MRO replication jobs ==
MRO provides two replication jobs.
{| class="wikitable" style="width: 100%;"
! Job
! Inheritance
! Purpose
|-
| '''ReplicateWorkpackageJob'''
| Derives from '''DispatchingJob''' for '''WorkPackage'''
| Generates a work package from the template and replication configuration of a maintenance plan.
|-
| '''ReplicateRoundWorkpackageJob'''
| Derives from '''ReplicateWorkpackageJob'''
| Generates the main work package of a maintenance round and the additional work packages configured by its child maintenance plans.
|}
Both jobs use the same scheduling, dispatching, and execution infrastructure. The maintenance plan implementation returns the appropriate job when the Maintenance Planning Orchestrator requests its replication job.
=== Work package replication ===
A standard maintenance plan uses '''ReplicateWorkpackageJob'''.
The maintenance plan provides:
* a template work package through '''LK_WP_TMPL'''
* an '''INSTANCE_REPLICATION''' object through '''LK_REPLICATION_CONFIG'''
* the maintenance plan settings required for automatic work package generation
The linked '''INSTANCE_REPLICATION''' object defines how the template work package is copied. The generated work package is not marked as a template.
For the complete maintenance plan prerequisites and the properties set on generated work packages, see [[MROMaintenancePlans]].
=== Round work package replication ===
A '''RoundMaintenancePlan''' uses '''ReplicateRoundWorkpackageJob'''.
The job creates the main work package from the Round Maintenance Plan. It then processes the child maintenance plans linked through '''SYSREL_ROUND_RELATION''' and creates their additional work packages. The additional work packages are assigned to the main round work package through '''TASK_OWNER'''.
Round work package replication uses the same BasicClient App, EnterpriseService, and dispatching setup as standard work package replication. The maintenance plan implementation determines which job is scheduled.
For the configuration and behaviour of Round Maintenance Plans, see [[MROMaintenancePlans]].
== Scheduling and execution ==
=== Maintenance Planning Orchestrator ===
The scheduling process executes the following method:
{| class="wikitable"
! Setting
! Value
|-
| Class
| '''UBIK.MRO.MaintenancePlanningOrchestrator'''
|-
| Method
| '''Apply'''
|}
The Maintenance Planning Orchestrator searches for eligible maintenance plans, requests the appropriate replication job from each plan, and schedules the job in '''MRO_JOB_DISPATCHING'''.
=== Scheduled Orchestrator ===
The execution process executes the following method:
{| class="wikitable"
! Setting
! Value
|-
| Class
| '''UBIK.ServiceTask.Orchestration.ScheduledOrchestrator'''
|-
| Method
| '''Apply'''
|}
The Scheduled Orchestrator searches '''MRO_JOB_DISPATCHING''' for scheduled jobs and executes them.
== MRO job dispatching ==
'''MRO_JOB_DISPATCHING''' is the specialised DISPATCHING Interface Administration MetaClass used for MRO replication jobs.
The orchestration process creates the required job objects automatically. Project teams do not need to create these objects manually.
The execution EnterpriseService identifies '''MRO_JOB_DISPATCHING''' through the '''InterfaceAdmin''' value in '''MRO.PARAM.json'''.
For general information about Interface Administration objects, see [[InterfaceAdministration]].
=== Job statuses ===
The execution status indicates the current state or result of a dispatching job.
{| class="wikitable" style="width: 100%;"
! Value
! Status
! Meaning
|-
| 0
| Undefined
| The execution state is undefined.
|-
| 1
| Success
| The execution completed successfully.
|-
| 2
| Terminated
| The execution was terminated.
|-
| 3
| Conflict
| An export conflict occurred.
|-
| 4
| Started
| Execution has started but has not yet completed.
|-
| 5
| Scheduled
| The job is scheduled but has not yet been executed.
|-
| 10
| Error
| An error occurred during execution.
|}
In a basic replication test, a newly scheduled job first has the status '''Scheduled'''. After successful execution, its status changes to '''Success'''.
== Application setup ==
A basic test or demonstration uses two separate UBIK.Studio folders.
{| class="wikitable" style="width: 100%;"
! Studio folder
! Purpose
! Required applications
|-
| Scheduling folder
| Provides the EnterpriseService web interface and starts the Maintenance Planning Orchestrator through the BasicClient App.
| '''UBIK.EnterpriseService.exe''' and '''UBIK.EnterpriseService.BasicClient.App.exe'''
|-
| Execution folder
| Runs the Scheduled Orchestrator and executes jobs from '''MRO_JOB_DISPATCHING'''.
| '''UBIK.EnterpriseService.exe'''
|}
The folder names and paths in the examples can be changed. Every configured path must point to the corresponding file in the local deployment.
== Scheduling folder setup ==
The scheduling folder requires the following files:
* '''UBIK.EnterpriseService.exe'''
* '''UBIK.EnterpriseService.exe.config'''
* '''UBIK.EnterpriseService.BasicClient.App.exe'''
* '''UBIK.EnterpriseService.BasicClient.App.exe.config'''
* '''JSON\ReplicateWorkpackageJob.json'''
=== Configure the scheduling EnterpriseService ===
In '''UBIK.EnterpriseService.exe.config''', configure the following application settings:
{| class="wikitable" style="width: 100%;"
! Setting
! Default value
! Required value
! Purpose
|-
| '''ExecuteWebInterface'''
| 0
| 1
| Enables the web interface used by the BasicClient App.
|-
| '''ExecuteTaskByJsonFile'''
| 0
| 0
| The scheduling EnterpriseService does not execute the recurring task configuration used by the execution EnterpriseService.
|-
| '''WebInterfacePort'''
| 9000
| 9000
| Defines the port used by the web interface in this example.
|-
| '''WebInterfaceHost'''
| http://localhost
| http://localhost
| Defines the host used by the web interface in this example.
|}
=== Configure the BasicClient App ===
In '''UBIK.EnterpriseService.BasicClient.App.exe.config''', configure the following application settings:
{| class="wikitable" style="width: 100%;"
! Setting
! Example value
! Purpose
|-
| '''BaseAddress'''
| http://localhost:9000
| Identifies the web interface exposed by the scheduling EnterpriseService.
|-
| '''PathToBasicEnterpriseServiceRequestJsonFile'''
| Full path to ReplicateWorkpackageJob.json
| Identifies the request file that starts the Maintenance Planning Orchestrator.
|-
| '''PathToBasicEnterpriseServiceRequestJsonFileList'''
| Empty
| No request file list is used in this setup.
|}
'''BaseAddress''' must match '''WebInterfaceHost''' and '''WebInterfacePort''' in the scheduling EnterpriseService configuration. Replace the example path with the actual path to '''ReplicateWorkpackageJob.json'''.
=== Configure ReplicateWorkpackageJob.json ===
Create '''ReplicateWorkpackageJob.json''' in the JSON folder and configure the target database, orchestrator class, and method:
<source lang="javascript">
{
"SSPI": true,
"SQLUser": "",
"SQLPassword": "",
"SQLServer": "(localdb)\\MSSQLLocalDB",
"SQLInitialCatalog": "JOB.TEST",
"ClassFullname": "UBIK.MRO.MaintenancePlanningOrchestrator",
"MethodName": "Apply"
}
</source>
Adapt the database settings to the target database. Keep '''ClassFullname''' and '''MethodName''' as shown so that the request executes '''UBIK.MRO.MaintenancePlanningOrchestrator.Apply'''.
== Execution folder setup ==
The execution folder requires the following files:
* '''UBIK.EnterpriseService.exe'''
* '''UBIK.EnterpriseService.exe.config'''
* '''JSON\MRO.json'''
* '''JSON\MRO.PARAM.json'''
=== Configure the execution EnterpriseService ===
In '''UBIK.EnterpriseService.exe.config''', configure the following application settings:
{| class="wikitable" style="width: 100%;"
! Setting
! Default value
! Required value
! Purpose
|-
| '''PluginExecutionConfigPath'''
| Empty
| Full path to '''MRO.json'''
| Identifies the recurring task configuration.
|-
| '''ExecuteWebInterface'''
| 0
| 0
| The execution EnterpriseService does not require the web interface in this setup.
|-
| '''ExecuteTaskByJsonFile'''
| 0
| 1
| Enables execution of the tasks configured in '''MRO.json'''.
|}
=== Configure MRO.json ===
Create '''MRO.json''' and configure the database connection, execution interval, Scheduled Orchestrator, and path to '''MRO.PARAM.json''':
<source lang="javascript">
{
"RepeateEveryMinutes": 0.2,
"SqlConnectionDefinition": {
"SSPI": true,
"SQLUser": "",
"SQLPassword": "",
"SQLServer": "(localdb)\\MSSQLLocalDB",
"SQLInitialCatalog": "JOB.TEST"
},
"Tasks": [
{
"ClassFullname": "UBIK.ServiceTask.Orchestration.ScheduledOrchestrator",
"MethodName": "Apply",
"MethodParameterPathFullName": "<full path to MRO.PARAM.json>"
}
]
}
</source>
Adapt the database settings and '''MethodParameterPathFullName''' to the target deployment. Keep '''ClassFullname''' and '''MethodName''' as shown so that the task executes '''UBIK.ServiceTask.Orchestration.ScheduledOrchestrator.Apply'''.
'''RepeateEveryMinutes''' defines how often the execution EnterpriseService checks for scheduled jobs. A value of 0 causes continuous checking. The value 0.2 can be used for a demonstration where continuous checking is not required.
=== Configure MRO.PARAM.json ===
Create '''MRO.PARAM.json''' and configure the UID of '''MRO_JOB_DISPATCHING''':
<source lang="javascript">
{
"InterfaceAdmin": "BBAF1C9E-8F3B-4C9A-9E2D-5F7A1C3E4B6D"
}
</source>
The '''InterfaceAdmin''' value identifies '''MRO_JOB_DISPATCHING''' for the Scheduled Orchestrator.
== Maintenance plan prerequisites ==
For a basic work package replication scenario, configure:
* a concrete maintenance plan type such as '''CyclicMaintenancePlan'''
* an asset through '''LK_ASSET'''
* a template work package through '''LK_WP_TMPL'''
* an '''INSTANCE_REPLICATION''' object through '''LK_REPLICATION_CONFIG'''
* '''PLAN_STATUS''' as Active
* '''AUTO_CREATE''' as enabled
* planning dates that make the plan eligible for generation
* a template work package with '''ISTEMPLATE''' set
The maintenance plan must not already have an open generated work package. Detailed generation conditions are documented in [[MROMaintenancePlans]].
== Basic test or demonstration ==
=== Prepare the maintenance plan ===
# Open the database in UBIK.Studio.
# Create or select a valid maintenance plan.
# Assign the required asset through '''LK_ASSET'''.
# Assign a template work package through '''LK_WP_TMPL'''.
# Verify that '''ISTEMPLATE''' is set on the template work package.
# Assign an '''INSTANCE_REPLICATION''' object through '''LK_REPLICATION_CONFIG'''.
# Set '''PLAN_STATUS''' to Active.
# Enable '''AUTO_CREATE'''.
# Configure the planning dates so that '''EARLIEST_GENERATION_DATE''' has been reached.
# Verify that the maintenance plan has no open generated work package.
=== Schedule the job ===
# Start '''UBIK.EnterpriseService.exe''' in the scheduling folder.
# Start '''UBIK.EnterpriseService.BasicClient.App.exe''' manually, or start it through a configured Windows Task Scheduler task.
# The BasicClient App sends the request defined in '''ReplicateWorkpackageJob.json''' to the scheduling EnterpriseService.
# '''UBIK.MRO.MaintenancePlanningOrchestrator.Apply''' searches for eligible maintenance plans and schedules their replication jobs.
=== Verify the scheduled job ===
# Open '''MRO_JOB_DISPATCHING''' in UBIK.Studio.
# Verify that a job object was created for the eligible maintenance plan.
# Verify that '''INTERFACE_EXECUTION_STATUS''' is Scheduled.
# If the execution EnterpriseService has not been started, verify that no generated work package exists yet.
=== Execute the job ===
# Start '''UBIK.EnterpriseService.exe''' in the execution folder.
# The EnterpriseService executes '''UBIK.ServiceTask.Orchestration.ScheduledOrchestrator.Apply''' according to '''MRO.json'''.
# The Scheduled Orchestrator reads the scheduled job from '''MRO_JOB_DISPATCHING'''.
# The configured replication job generates the work package.
=== Verify the result ===
# Refresh '''MRO_JOB_DISPATCHING'''.
# Verify that the job status is Success.
# Refresh the Work Package MetaClass.
# Verify that a new work package was created.
# Verify that '''ISTEMPLATE''' is not set on the generated work package.
# Verify the links and planning values described in [[MROMaintenancePlans]].
For a Round Maintenance Plan, also verify that:
* the main round work package was created
* the child maintenance plans produced the configured additional work packages
* the additional work packages are assigned to the main round work package through '''TASK_OWNER'''
== Triggering the scheduling process ==
For a manual test or demonstration, start '''UBIK.EnterpriseService.BasicClient.App.exe''' manually.
For recurring execution, a Windows Task Scheduler task can start '''UBIK.EnterpriseService.BasicClient.App.exe'''. The executable path is configured in the task. The request and target orchestrator are configured in '''UBIK.EnterpriseService.BasicClient.App.exe.config''' and '''ReplicateWorkpackageJob.json'''.
Running the Maintenance Planning Orchestrator processes all eligible maintenance plans.
== Configuration summary ==
{| class="wikitable" style="width: 100%;"
! Component
! Configuration
! Purpose
|-
| Scheduling EnterpriseService
| '''ExecuteWebInterface''' = 1
| Exposes the web interface used by the BasicClient App.
|-
| BasicClient App
| '''PathToBasicEnterpriseServiceRequestJsonFile'''
| Points to '''ReplicateWorkpackageJob.json'''.
|-
| Scheduling request
| '''UBIK.MRO.MaintenancePlanningOrchestrator.Apply'''
| Searches for eligible maintenance plans and schedules their jobs.
|-
| Execution EnterpriseService
| '''ExecuteTaskByJsonFile''' = 1
| Enables execution using '''MRO.json'''.
|-
| Execution task
| '''UBIK.ServiceTask.Orchestration.ScheduledOrchestrator.Apply'''
| Processes scheduled dispatching jobs.
|-
| Execution parameter
| '''InterfaceAdmin'''
| Identifies '''MRO_JOB_DISPATCHING'''.
|-
| Maintenance plan
| '''LK_REPLICATION_CONFIG'''
| Links directly to the '''INSTANCE_REPLICATION''' object used to copy the template work package.
|}
== See also ==
* [[MROMaintenancePlans]]
* [[InterfaceAdministration]]
* [[InterfaceExecution]]