brexis / laravel-workflow

Use the Symfony Workflow component in Laravel
MIT License
281 stars 105 forks source link

Symfony 4.1 metadata is not accessible #28

Closed WulfP closed 5 years ago

WulfP commented 6 years ago

even after changes from New in Symfony 4.1: Workflow improvements were applied:

WorkflowRegistry.php:

use Symfony\Component\Workflow\SupportStrategy\InstanceOfSupportStrategy; public function add(Workflow $workflow, $supportStrategy) { $this->registry->addWorkflow($workflow, new InstanceOfSupportStrategy($supportStrategy)); }

InMemoryMetadataStore {#1152 -workflowMetadata: [] -placesMetadata: [] -transitionsMetadata: SplObjectStorage {#1153 storage: [] } } metadata ist defined but MetadataStore stays empty.

Sorry. I tried but was not able to fix it. Maybe some Symfony-Components to handle metadata are missing.

brexis commented 6 years ago

Hi @WulfP. We do not support yet Symfony Workflow 4.1. You may need to lock the Symfony Workflow version to 4.1.

MyDigitalLife commented 6 years ago

Seeing that 4.1 is not support the composer.json should be updated to reflect this. This way there is no question if it is supported or not.

ClaudioVarandas commented 6 years ago

Hi, I think to support Symfony Workflow 4.1 , in class WorkflowRegistry:

this line: $this->registry->add($workflow, new ClassInstanceSupportStrategy($supportStrategy));

can be changed to: $this->registry->addWorkflow($workflow, new InstanceOfSupportStrategy($supportedStrategy));

Tested here and works.

brexis commented 5 years ago

Fixed in the last release 1.3.0.