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:
-
Verify Event Generation:
- Query data stream API to confirm events are being ingested
- Check event payload structure matches Thing Modeler definition
-
Create Event Type Mapping:
- Map your custom IoT event to a business event type
- Ensure property mappings are complete and correct
- Activate the mapping
-
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
-
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:
-
Mapping Not Activated: Event type mapping exists but isn’t set to active=true
-
Property Name Mismatch: Rule references event.temperature but mapping provides `event.temp
-
Event Filtering: Rules engine might have filters that exclude your events (check event routing rules)
-
Timing Issues: If rule activation happened after events were generated, historical events won’t trigger the rule (only new events)
-
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.