Running the Advanced PM Engine Manually via Developer Console
Using the Developer Console, admins can manually run the Advanced PM Engine to quickly generate PM Work Orders and automatically associate relevant Work Plans and Service Products. This allows admin level users to test the Advanced PM Engine without waiting for the PM Process’s schedule runtime.
Prerequisite
Enable and configure the Advanced PM engine in your org by setting the Global Settings, GBL046 and GBL047 to True for Time-Based and Condition-Based PM Plans respectively.
To manually run the Advanced PM Engine:
1. From the Home page, go to Setup > Developer Console.
The Developer Console window is displayed.
2. Click Debug > Open Execute Anonymous Window.
3. In the Enter Apex Code window, provide any of the following scripts for Time-Based PM Engine or Condition-Based PM Engine:
Time-Based PM Engine:
String pmProcessId = 'process_id';// Process Name: <Demo PM Process>
SVMXC.APE_ProcessLauncher apeProcess = new SVMXC.APE_ProcessLauncher();
apeProcess.setProcessIdentifier(pmProcessId);
apeProcess.startPMProcess();
Condition-Based PM Engine:
String pmProcessId = 'process_id';// Process Name: <Demo CB PM Process>
SVMXC.APE_ProcessLauncher apeProcess = new SVMXC.APE_ProcessLauncher();
apeProcess.setProcessIdentifier(pmProcessId);
apeProcess.startCBPMProcess();
Parameter
Description
pmProcessId
Enter either Salesforce ID or PM Process ID of the PM Process you want to run. You must provide this value for the pmProcessId parameter after the equal sign in the above script.
* 
The PM Process ID refers to the Process ID of a PM Process.
The Salesforce ID can be found in the PM Process URL. For example, in the following URL, “a2gDw000004EoWpIAK” is the Salesforce ID:https://test.sandbox.lightning.force.com/lightning/cmp/SVMXC__pmProcessDetail?c__actionName=edit=a2gDw000004EoWpIAK
Process Name
Enter the name of the PM Process.
4. Click Execute.
The PM engine evaluates PM Plans and generates PM Work Orders, assigning relevant Work Plans and Service Products.
Was this helpful?