- Can I use dmstr/flowable-bundle with Laravel directly, or is it strictly for Symfony/API Platform?
- This bundle is designed for Symfony 7 and API Platform 4, not Laravel. However, you could integrate it into a Laravel app via a Symfony microkernel or by exposing its HTTP endpoints as a microservice. The bundle relies heavily on Symfony’s dependency injection and API Platform’s resource system, which aren’t natively available in Laravel.
- What Laravel alternatives exist for integrating Flowable BPMN workflows?
- For Laravel, consider packages like `spatie/laravel-flowable` (if available) or build a custom wrapper around Flowable’s REST API using Guzzle HTTP client. Alternatively, use Laravel’s queue system to offload workflow interactions to a Symfony microservice running this bundle. No direct Laravel-native bundle exists for Flowable yet.
- How do I handle authentication securely for the Flowable REST API in production?
- Use Symfony’s `ParameterBag` or a secrets manager (like Vault) to store credentials. Configure `auth_type` in `api_configuration.yaml` as either `basic` (with `username`/`password`) or `bearer` (with a token). Avoid hardcoding credentials in config files; rely on environment variables or Symfony’s `%env()` syntax for runtime resolution.
- Will this bundle work with Laravel’s queue system for async workflow processing?
- Not natively, but you can extend it. The bundle emits no Laravel queue jobs, but you could wrap its HTTP client in a Laravel queueable job (e.g., `DispatchFlowableTask::dispatch()`) to defer workflow interactions. For real-time updates, pair it with Symfony’s Messenger component or Mercure to push state changes to Laravel via webhooks.
- What Laravel versions or stacks is this bundle compatible with?
- This bundle is **not** compatible with Laravel. It’s built for Symfony 7 + API Platform 4. If you’re using Laravel, you’d need to create a separate Symfony microservice or API layer to host this bundle and communicate with it via HTTP. The bundle itself requires PHP 8.4, Symfony 7, and API Platform 4.
- How do I test workflow interactions in unit tests without hitting a real Flowable REST API?
- Mock the HTTP client used by the bundle. Override the `FlowableBundle`'s service definition in your test container to inject a custom client (e.g., using `HttpClientInterface` mocks). For API Platform resources, use its built-in test clients with mocked responses. Example: `self::$client->request('GET', '/api/flowable/tasks', [], [], ['HTTP_AUTHORIZATION' => 'Bearer mock-token']);`
- What happens if the remote Flowable REST engine goes down? Can I implement retries or fallbacks?
- The bundle doesn’t include built-in retry logic, but you can wrap its HTTP client in a circuit breaker (e.g., Symfony’s `RetryStrategy` or a library like `php-resilience`). For fallbacks, queue failed requests (e.g., using Symfony Messenger) and notify admins via email or Slack. Consider local caching (Redis) for critical workflow state to reduce dependency on the remote engine.
- Do I need to manage a local database for workflow state, or is everything handled remotely?
- Everything is handled remotely. The bundle **does not** store workflow state locally—it acts as a pass-through to your Flowable REST engine. This reduces database management but introduces latency risks. For high-performance needs, cache frequent queries (e.g., active tasks) in Redis or another local store.
- Can I extend the bundle to support custom BPMN features (e.g., task listeners, custom variables)?
- Yes, but with limitations. The bundle exposes standard Flowable REST endpoints, so custom BPMN features must be supported by your Flowable engine. For local logic, extend the provided `AbstractFlowableResource` or create custom services that interact with the bundle’s HTTP client. Note that complex payloads may require custom DTOs or schema validation.
- How do I monitor workflow execution metrics (e.g., duration, failures) in production?
- The bundle logs workflow interactions to a dedicated `flowable` Monolog channel. Configure your logging system (e.g., ELK, Datadog) to capture these logs. For metrics, extend the bundle’s resources to emit Prometheus-compatible stats or integrate with Symfony’s `Stopwatch` component. Track HTTP response times and error rates via your monitoring tool.