temporalio / sdk-php

Temporal PHP SDK
https://php.preview.thundergun.io
MIT License
270 stars 45 forks source link

Support WorkflowIdConflictPolicy for Signal-With-Start API #479

Closed stephanos closed 2 months ago

stephanos commented 2 months ago

See https://github.com/temporalio/features/issues/437

This is a follow-up to https://github.com/temporalio/sdk-php/pull/417 which added it to StartWorkflow.

roxblnfk commented 2 months ago

Hi 👋 The WorkflowOptions settings work the same for start() and startWithSignal().

$workflowClient = \Temporal\Client\WorkflowClient::create(
    ServiceClient::create('localhost:7233')
);

$stub = $workflowClient->newWorkflowStub(
    TestWorkflow::class,
    \Temporal\Client\WorkflowOptions::new()
        ->withWorkflowIdConflictPolicy(\Temporal\Common\WorkflowIdConflictPolicy::Fail)
);

$workflowClient->startWithSignal($stub, 'test-signal');

Please reopen the issue if this does not work.

stephanos commented 2 months ago

@roxblnfk Awesome, thank you for confirming! I couldn't quite tell.