Business rule not triggering on IoT event integration with rules engine

Business rule configured to react to a custom IoT event isn’t triggering in the SAP IoT rules engine. The rule is supposed to create a work order when a temperature sensor exceeds 85°C, but despite seeing the events in the data stream, the rule never fires.

I’ve verified the event type mapping in the rule configuration and the custom event schema looks correct. The rules engine logs don’t show any errors - it’s as if the events aren’t reaching the rules engine at all. Is there a registration step I’m missing to connect custom IoT events to the business rules engine?

The rule is definitely active. I found the Event Type Mapping section but I’m not clear on how to set it up correctly. Do I need to create a new business event type or can I map directly to an existing one?

You can map to an existing business event type if one fits your use case, but for custom IoT events I usually create a new business event type specifically for that sensor/device type. This gives you more control over the event schema and makes the rule conditions clearer. Make sure the property names in your custom event schema match what the rule is checking for.

The event type mapping is tricky. When you create a custom event in Thing Modeler, you need to explicitly map it to the rules engine event catalog. This isn’t automatic. Go to the Event Type Mapping configuration and create a mapping between your custom IoT event type and the corresponding business event type that the rules engine expects. Without this mapping, events won’t flow to the rules engine even if they’re being ingested successfully.

Your issue involves three components that must be correctly configured for IoT event-triggered business rules:

1. Event Type Mapping Configuration:

This is likely your main problem. SAP IoT uses a two-tier event model:

  • IoT Events: Raw device events from Thing Modeler
  • Business Events: Structured events consumed by rules engine

You must explicitly map between them:

Navigate to: IoT Configuration > Event Type Mapping

Create mapping:

{
  "sourceEventType": "iot.device.temperature.threshold",
  "targetEventType": "business.sensor.alert",
  "propertyMappings": [
    {"source": "deviceId", "target": "sensorId"},
    {"source": "temperature", "target": "currentValue"},
    {"source": "timestamp", "target": "eventTime"}
  ],
  "active": true
}

Without this mapping, IoT events remain in the data stream but never become business events that the rules engine can process.

2. Custom Event Schema Validation:

Your custom event schema must match what the rule expects. Verify in Thing Modeler:

  • Event type name: Must be exactly as referenced in rule condition
  • Property types: Must match (string vs number vs boolean)
  • Required properties: All properties used in rule must be present in event

Common schema mismatch:


Rule expects: event.temperature > 85
Event provides: event.temp (wrong property name)

3. Rules Engine Logs Analysis:

The logs “not showing errors” is a symptom, not the root cause. Enable detailed logging:

Go to: Rules Engine > Configuration > Logging

Set level to: DEBUG

Then check these specific log categories:

  • Event Routing: Shows if events reach rules engine
  • Rule Evaluation: Shows if rule conditions are being checked
  • Action Execution: Shows if rule actions fire

Typical log sequence for working rule:


[Event Routing] Received event: iot.device.temperature.threshold
[Event Mapping] Mapped to: business.sensor.alert
[Rule Evaluation] Evaluating rule: TempThresholdWorkOrder
[Rule Evaluation] Condition met: temperature=87 > 85
[Action Execution] Creating work order: WO-12345

If you only see the first line, the mapping is missing.

Complete Setup Checklist:

  1. Verify Event Generation:

    • Query data stream API to confirm events are being ingested
    • Check event payload structure matches Thing Modeler definition
  2. Create Event Type Mapping:

    • Map your custom IoT event to a business event type
    • Ensure property mappings are complete and correct
    • Activate the mapping
  3. Configure Business Rule:

    • Event trigger: Use the TARGET business event type (not source IoT event)
    • Condition: Reference properties from business event schema
    • Action: Define work order creation with required fields
    • Activate the rule
  4. Test End-to-End:

    • Generate a test event (temperature > 85°C)
    • Check event ingestion logs (should see IoT event)
    • Check event routing logs (should see mapping to business event)
    • Check rules engine logs (should see rule evaluation and action)
    • Verify work order was created

Common Pitfalls:

  1. Mapping Not Activated: Event type mapping exists but isn’t set to active=true

  2. Property Name Mismatch: Rule references event.temperature but mapping provides `event.temp

  3. Event Filtering: Rules engine might have filters that exclude your events (check event routing rules)

  4. Timing Issues: If rule activation happened after events were generated, historical events won’t trigger the rule (only new events)

  5. Tenant Configuration: Some tenants require explicit enablement of IoT-to-Business event integration (check with SAP support)

Debugging Commands:

Check if events reach rules engine:


GET /rules/v1/events?type=business.sensor.alert&from=2025-06-02T14:00:00Z

Check rule execution history:


GET /rules/v1/rules/{ruleId}/executions?from=2025-06-02T14:00:00Z

If these return empty results, your events aren’t being routed to the rules engine, confirming the mapping is missing or incorrect.

Implement the event type mapping first, then verify each step in the chain. The rules engine is working fine - it’s just not receiving your events in the format it expects.

Another thing to check - the rules engine logs might not show errors if the event isn’t reaching the engine at all. Check the event ingestion logs first to verify your custom events are being received by the platform. Then check the event routing logs to see if they’re being forwarded to the rules engine. There’s usually a routing configuration that determines which events get sent to which processing engines.