Skip to content

BPMN Panel API / Shared Types / MethodRunObject

Type Alias: MethodRunObject

ts
type MethodRunObject = {
  parent: string;
  method: string;
  objects: string[];
  params?: unknown;
};

Defined in: features/actions/methods/run-method/types.ts:90

Configuration for running a custom backend method via /MetaMethods/Run endpoint.

Used in entity creation to execute custom backend logic instead of standard object/link creation endpoints. When configured in EditorType.runMethod, form field values are automatically merged with pre-configured params.

Examples

Basic Object Creation

typescript
{
  parent: "WorkOrder",
  method: "CreateWithValidation",
  objects: [],
  params: {}
}

With Pre-configured Parameters

typescript
{
  parent: "WFEntityInstance",
  method: "createWorkflowInstance",
  objects: [],
  params: {
    workflowType: "production",
    autoStart: true
  }
}

When form has fields name and priority, the final request merges:

  • Pre-configured params: workflowType, autoStart
  • Form field values: name, priority

Event-based Object Selection

typescript
{
  parent: "WFEntityInstance",
  method: "getWorkFlowGraphState",
  objects: [],
  params: {
    getSelectedObjectForEventId: "workorder--on-object-select--link-table"
  }
}

The selected object's GUID will be retrieved using the event ID, enabling context-aware object creation across panels.

Link Creation with Custom Method

typescript
{
  parent: "ProductSupplier",
  method: "CreateLinkWithBusinessRules",
  objects: ["product-guid", "supplier-guid"],
  params: {
    sourceGuid: "product-guid",
    targetGuid: "supplier-guid",
    linkName: "ProductSupplier"
  }
}

Pre-configured objects are merged with resolved source/target GUIDs.

Properties

PropertyTypeDescription

parent

string

Parent object or class name on the backend.

Identifies the context in which the method should be executed.

Examples

ts
"WorkOrder"
ts
"WFEntityInstance"
ts
"ProductSupplier"

method

string

Method name to execute on the backend.

The backend method receives the objects array and params object as arguments and can perform custom creation/validation logic.

Examples

ts
"CreateWithValidation"
ts
"createWorkflowInstance"
ts
"getWorkFlowGraphState"

objects

string[]

Array of object GUIDs to pass to the method.

For object creation, typically an empty array or pre-configured GUIDs. For link creation, automatically includes source and target GUIDs, merged with any pre-configured values (deduplicated).

Examples

Empty for standalone object creation

[]

Pre-configured context object

["pre-configured-guid"]

Resolved at runtime for links

["source-guid", "target-guid"]

params?

unknown

Pre-configured parameters to merge with form field values.

When the form is submitted:

  1. Pre-configured params are used as the base
  2. Form field values are merged on top (taking precedence)
  3. For links, sourceGuid, targetGuid, and linkName are added

Common use cases:

  • Fixed configuration values (e.g., workflowType, autoStart)
  • Event-based selections (e.g., getSelectedObjectForEventId)
  • Default values that can be overridden by form fields

Example

typescript
// Pre-configured params
{
  workflowType: "production",
  autoStart: true
}
// After merging with form fields {name: "WF-001", priority: 5}:
{
  workflowType: "production",
  autoStart: true,
  name: "WF-001",
  priority: 5
}