Execution Flow

  1. Workflow Process Creation: A CPD-controlled item (Change Order, Change Request, Change Task, etc.) creates a Workflow Process based on the default Workflow Map.
  2. Event Trigger: The Workflow Process onAfterAdd event fires after the workflow is created.
  3. Rule Retrieval: The dynamic assignment engine queries the related Change Process Definition and retrieves all enabled Workflow Assignment Rules configured for the workflow.
  4. Sequence Ordering: Rules are sorted by their Sequence value in ascending order (lowest to highest).
  5. Rule Filtering: The system identifies which rules apply based on Target configuration:
    • Workflow target rules: Execute once with the Workflow Process as context
    • Activity target rules: Execute for each matching Activity in the workflow
  6. Context Preparation: For each rule execution, the system adds context attributes to the target item:
    • @context_type_id: Item Type ID of the CPD-controlled item (e.g., Change Order)
    • @context_item_id: Item ID of the CPD-controlled item
  7. Rule Method Invocation: Each rule’s method is called with the prepared context item:
    • Method receives Workflow Process or Activity as this
    • Method can access context attributes to query the source item
    • Method creates or modifies Activity Assignment items as needed
  8. Assignment Creation: Rule methods modify Activity Assignment items according to custom business logic.
  9. Error Collection: The system tracks execution results for each rule (see Section 7.4.2 for error handling details).
  10. Completion: Workflow becomes active with assignments established or fails if errors occurred.

Context Information

Rule methods receive context information through XML attributes on the target item:

// These attributes are set by the rule execution engine
string contextTypeId = this.getAttribute(“context_type_id”);
string contextItemId = this.getAttribute(“context_item_id”);

// Example: Loading the source Change Order
Innovator inn = this.getInnovator();
Item sourceItem = inn.newItem();
sourceItem.setAction(“get”);
sourceItem.setAttribute(“typeId”, contextTypeId);
sourceItem.setID(contextItemId);
sourceItem = sourceItem.apply();

// Now you can access Change Order properties, affected items, etc.

This context enables rules to make assignment decisions based on

  • Affected items and their properties (owners, classification, etc.)
  • Supporting data attached to the change
  • Change Order properties (priority, description, managed_by_id)
  • Related workflow or activity information