How-toEpicor KineticBusiness Process Management

How to Create a BPM Method Directive in Epicor Kinetic

Question
how to create a BPM method directive in Epicor

Also searched as

  • Epicor BPM pre-processing vs post-processing
  • Epicor Kinetic BPM Workbench tutorial
  • Epicor method directive condition widget action
  • Epicor BPM show message example

Short answer

In Epicor Kinetic, open Business Process Management > Method Directive Maintenance (the BPM Workbench), pick the business object and method, choose Pre-Processing, Base Processing or Post-Processing, then add a condition and actions such as Show Message or Set Field. Enable it and test in a pilot company before production.

Applies to: Epicor Kinetic 2021.x to current and Epicor ERP 10.2.x; Method, Data and Function directives (this page covers Method directives)

Create and deploy a Method Directive

  1. 1Open System Management > Business Process Management > Directive Maintenance (BPM Workbench) and choose New Method Directive.
  2. 2Select the business object and method. For example, Erp.BO.JobEntry and Update to act when a job is saved, or Erp.BO.SalesOrder and Update for order changes.
  3. 3Choose when it runs. Pre-Processing runs before the method and can stop or alter the data. Post-Processing runs after the standard logic. Base Processing replaces nothing but sits around the standard step.
  4. 4Add a Condition widget. Use Condition (Where the data or the changed row meets a test) such as 'Number of rows in ttJobHead where JobEngineered is changing to true is at least 1'.
  5. 5Attach an Action to the true branch: Show Message (warning or error), Set Field, Send Email, or Invoke BO Method. Use Raise Exception to block the save.
  6. 6Save, then Validate the directive. Fix syntax errors in any custom code widget flagged by the validator.
  7. 7Tick Enabled, deploy to a pilot or test company first, and run the real screen action to confirm behaviour.
  8. 8Check the Tracker or the BPM log for runtime exceptions, then promote to production through your normal change control.

Pre, base or post: choosing the right point

The most common beginner mistake is putting logic at the wrong point. Pre-Processing sees the incoming data in temporary tables (ttJobHead style) before Epicor validates and writes it. Use it to validate input, default fields, or block a save with a clear message.

Post-Processing runs after the standard method succeeds. Use it for side effects: sending an email, writing to a UD table, creating a related record, or calling an external API. If a post-processing action fails, the standard change may already be done, so write defensively.

A Data Directive (In-Transaction) is a different type that runs inside the database transaction on table-level changes. Use it when you must guarantee the extra change commits or rolls back with the main one. Method Directives are easier to debug; Data Directives are safer when atomicity matters.

Conditions and actions that cover most requests

Most requests fall into a small set. Block a save when a field is blank: Pre-Processing, condition on the temp table row, action Raise Exception with a clear message. Default a field: Pre-Processing, Set Field. Notify on a status change: Post-Processing, condition comparing the new value to the original, action Send Email.

To compare old and new values, use the condition option that tests the changed row against the original row in the dataset. That avoids firing on every save, which is the number one cause of noisy directives and slow screens.

Keep each directive to one purpose and give it a descriptive name with the method in it. Large directives that do five jobs are hard to disable when something goes wrong.

Custom code widgets and what to keep out of them

A Custom Code action lets you write C# against the dataset. It is powerful, but it is where upgrades and performance problems start. Prefer standard widgets and Epicor Functions for reusable logic, and call them from the directive.

Never run long external calls in Pre-Processing. The user is waiting on the screen and the transaction is open. Push slow work to Post-Processing, or to a Function that queues the work, and handle timeouts.

// Custom code snippet in a Pre-Processing directive (read the row, block on rule)
foreach (var row in ttJobHead.Where(r => r.RowMod == "U" || r.RowMod == "A"))
{
    if (row.JobEngineered && string.IsNullOrWhiteSpace(row.PartNum))
    {
        this.PublishInfoMessage("A part number is required to engineer a job.", Ice.Common.BusinessObjectMessageType.Error, Ice.Bpm.InfoMessageDisplayMode.Individual, "JobHead", "PartNum");
    }
}

Testing, logging and rollback

Test with the real screen action in a test company, not only the Validate button. Validation proves the syntax, not the behaviour. Watch for the message text, the data effect and the time the save takes with and without the directive enabled.

Keep a record of what is deployed. Directives can be exported and imported between environments, which is how you promote them. Disable rather than delete when you back out a change, so the history stays.

Common pitfalls

  • !Creating a Pre-Processing directive that fires on every save because the condition does not compare old and new values.
  • !Doing slow web calls or heavy queries inside Pre-Processing while the user waits and the transaction is open.
  • !Editing the directive directly in production without exporting a copy first.
  • !Raising an exception in Post-Processing and expecting the standard change to roll back; it may already be committed.
  • !Writing the same rule twice, once in a directive and once in a UI customization, so they disagree after an upgrade.

How an ERP-grounded AI assistant handles this

An assistant grounded in your Epicor environment can read your existing directives, find the ones that touch a given business object, and draft the condition and action for a new rule for a developer to review. It can also explain a directive's message when users report one. It should not enable or deploy directives itself; that stays with the developer and the change process.

Frequently asked questions

What is the difference between a Method Directive and a Data Directive in Epicor?

A Method Directive attaches to a business object method such as Update and runs before, after or around it. A Data Directive attaches to a table and runs inside the database transaction on add, change or delete. Use a Method Directive for validation and messages; use a Data Directive when the change must commit together.

How do I stop a save with a message in Epicor BPM?

Use a Pre-Processing Method Directive on the business object Update method, add a condition that detects the bad data, and add a Raise Exception action or Show Message set to Error. The save is cancelled and the user sees the text. Make the message state what to fix.

Where do I see BPM errors in Epicor Kinetic?

Errors appear to the user as a dialog and in the server logs. Administrators can review them in the Server log of the application server or through the Tracker and BPM logging options. Enable detailed logging only briefly, since it adds overhead to busy business objects.

Do BPM directives survive an Epicor upgrade?

Standard directives are stored in the database and carry over, but any custom code can break if the business object or dataset changed. Always revalidate and retest each directive in a test environment after an upgrade, starting with those using custom code widgets.

Related

Error fix

Fixing Epicor BusinessObjectException: BPM Directive Errors

A BusinessObjectException that says "A Business Process Management (BPM) directive has raised the following error" means a directive on that business object stopped the transaction, either deliberately via a Raise Exception widget or accidentally via an unhandled .NET error in Custom Code. Expand the InnerException on the error dialog to see the real message and the directive name, then open BPM Designer for that object and method to find the widget that fired.

Advanced

How to create and call an Epicor Function

Open Function Studio from the main menu (Customization > Function Studio) or from inside a BPM designer's Call Context widget, define a Library and Function with typed inputs/outputs, write the logic in the C# widget, then compile and test with the built-in test harness before calling it from a BPM directive, a dashboard, or another function.

How-to

Preserving Customizations When Upgrading to Epicor Kinetic

Epicor Kinetic's web UI does not simply inherit classic smart-client customizations - most need to go through the Update Customization / Application Studio conversion process, and some WinForms-specific customizations cannot convert directly and must be rebuilt in the Kinetic designer. Plan the upgrade as a customization inventory and rework project, not a single technical cutover step.

Error fix

Epicor Kinetic: Job Will Not Release in Job Entry

A job in Epicor Kinetic will not release when it is not Engineered, when a material or operation fails validation, or when the part revision on the job is not approved. Open Job Entry, confirm the Engineered flag first, fix any part, revision or method errors shown in the exception panel, then tick Released.

How-to

Fixing a Slow Epicor BAQ (Business Activity Query)

A slow BAQ in Epicor is usually caused by unindexed join columns, a subquery or calculated field forcing a table scan, or the BAQ pulling far more rows than the dashboard actually displays before filtering client-side. Fix it by reading the SQL Server execution plan Epicor generates, moving filters into the BAQ criteria instead of the dashboard filter panel, and replacing subqueries with joins where possible.

How-to

Epicor MRP Runs but Generates No Suggestions

When Epicor's MRP process completes without a job or purchase suggestion for a part you expect one for, the cause is almost always the part's own configuration (Part Class Type, Make Direct, Non-MRP flag, planning Time Fence) or the demand not being linked in a way MRP recognizes, not a defect in the MRP engine. Work through the part's Planning tab, its safety stock and lead time setup, and the demand source (sales order line status, job material requirement) before assuming the run itself failed.

AI for ERP

AI for Epicor Kinetic, Beyond What Prism Covers

Add AI to Epicor Kinetic beyond Prism: private LLM over BAQs, BPM data, and REST v2, on-prem or private cloud, with honest guidance on when Prism already covers you.

AI for ERP

Private AI for Epicor Kinetic Cloud, Outside the Multi-Tenant Boundary

Ground a private LLM on Epicor Kinetic Cloud via BAQs, REST v2, and Data Fabric so sensitive manufacturing data never enters a multi-tenant AI feature.

Stuck on Epicor Kinetic?

Talk to engineers who work inside Epicor Kinetic every week, and who build private AI that answers these questions from your own ERP data.