a536baabd6
Adds the complete project foundation: - BMAD BMM workflow tooling (_bmad/) - Claude slash commands, skills, and project memories (.claude/) - ESP32 firmware scaffold (PlatformIO + Waveshare e-ink driver) - .gitignore excluding _bmad-output/ and .pio/ build artifacts Planning artifacts (PRD, architecture, epics) are intentionally not tracked — they live in _bmad-output/ per project convention. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.8 KiB
2.8 KiB
Integration Reference
Patterns for building integrations in OroCommerce.
Oro IntegrationBundle Pattern
For managed integrations visible in System > Integrations:
- Transport -- implements
TransportInterface, handles connectivity - Connector -- implements
ConnectorInterface, defines sync logic per entity - Channel Type -- defines the integration type shown in UI
Transport
class MyTransport implements TransportInterface
{
public function init(Transport $transportEntity): void { }
public function getLabel(): string { return 'My Integration'; }
public function getSettingsFormType(): string { return MyTransportSettingsType::class; }
public function getSettingsEntityFQCN(): string { return MyTransportSettings::class; }
}
Tag: { name: oro_integration.transport, type: my_integration, channel_type: my_channel }
Connector
class MyConnector implements ConnectorInterface
{
public function getLabel(): string { return 'My Connector'; }
public function getType(): string { return 'my_entity'; }
public function getImportEntityFQCN(): string { return MyEntity::class; }
public function getImportJobName(): string { return 'my_import_job'; }
}
Tag: { name: oro_integration.connector, type: my_entity, channel_type: my_channel }
API-Based Integration (Middleware)
For external API integrations not using the IntegrationBundle:
- Create an HTTP client service wrapping Symfony HttpClient
- Store credentials in system configuration (see system-config pattern)
- Use MQ processors for async data sync
- Implement retry/backoff for resilience
- Use notification alerts for failure reporting
Import/Export Services
services:
acme.importexport.data_converter:
parent: oro_importexport.data_converter.configurable
acme.importexport.processor.export:
parent: oro_importexport.processor.export_abstract
calls:
- [setDataConverter, ['@acme.importexport.data_converter']]
tags:
- { name: oro_importexport.processor, type: export,
entity: 'Acme\Bundle\ExampleBundle\Entity\Example',
alias: acme_example }
acme.importexport.processor.import:
parent: oro_importexport.processor.import_abstract
calls:
- [setDataConverter, ['@acme.importexport.data_converter']]
tags:
- { name: oro_importexport.processor, type: import,
entity: 'Acme\Bundle\ExampleBundle\Entity\Example',
alias: acme_example }
Notification Alerts
Use Oro\Bundle\NotificationAlertBundle to surface integration failures:
$this->notificationAlertManager->addNotificationAlert(
NotificationAlert::createForIntegration($integration, 'Sync failed: ...')
);