- Issue created by @camoa
- πΊπΈUnited States camoa
Entity Is Mapped to Salesforce condition implemented and committed.
What it does: Check if a Drupal entity has a Salesforce mapping. Optionally stores the mapping information in tokens for use by subsequent actions. Essential for conditional workflows based on Salesforce sync status.
Key features:
- Check for ANY mapping or specific mapping ID
- Works with entity from context or token
- Optionally stores mapping info in tokens (eliminates need for separate action)
- Supports multiple mappings per entity
- Clean pass/fail condition for ECA workflows
Configuration options:
- Entity token: Optional, uses context entity if empty
- Mapping ID: Optional, check for specific mapping
- Store mapping tokens: Save mapping info for subsequent actions
- Token name: Name for stored mapping data
Stored tokens (when enabled):
[token:salesforce_id]
- The Salesforce record ID[token:salesforce_object_type]
- Object type (Contact, Lead, etc.)[token:mapping_id]
- Salesforce mapping configuration ID[token:salesforce_url]
- Direct Salesforce URL[token:last_sync_status]
,[token:last_sync_action]
Example usage:
- Entity view: Only show Salesforce fields if entity is mapped
- Complete workflow: Condition stores tokens, next action uses
[token:salesforce_id]
to fetch fields - Specific mapping: Check if entity uses "contact_mapping" specifically
- Pre-operation check: Verify mapping exists before sync operations
Testing: Successfully tested with mapped and unmapped entities. Token storage works perfectly, enabling streamlined workflows without separate mapping lookup actions.
Files added/changed:
src/Plugin/ECA/Condition/EntityIsMapped.php
(new condition)config/schema/salesforce_eca.schema.yml
(configuration schema)
Now you can create conditional workflows based on Salesforce mapping status, with optional token storage for maximum efficiency.
Automatically closed - issue fixed for 2 weeks with no activity.