|
17 | 17 | use Temporal\Common\TypedSearchAttributes; |
18 | 18 | use Temporal\DataConverter\EncodedCollection; |
19 | 19 | use Temporal\DataConverter\EncodedValues; |
20 | | -use Temporal\Interceptor\WorkflowInbound\WorkflowInput; |
21 | | -use Temporal\Interceptor\WorkflowInboundCallsInterceptor; |
22 | 20 | use Temporal\Internal\Declaration\Instantiator\WorkflowInstantiator; |
23 | 21 | use Temporal\Internal\Declaration\Prototype\WorkflowPrototype; |
24 | 22 | use Temporal\Internal\ServiceContainer; |
@@ -92,38 +90,11 @@ public function handle(ServerRequestInterface $request, array $headers, Deferred |
92 | 90 | ); |
93 | 91 | $runId = $request->getID(); |
94 | 92 |
|
95 | | - $starter = function (WorkflowInput $input) use ( |
96 | | - $resolver, |
97 | | - $instance, |
98 | | - $context, |
99 | | - $runId, |
100 | | - ): void { |
101 | | - $context = $context->withInput(new Input($input->info, $input->arguments, $input->header)); |
102 | | - $process = new Process($this->services, $context, $runId); |
103 | | - $this->services->running->add($process); |
104 | | - $resolver->resolve(EncodedValues::fromValues([null])); |
105 | | - |
106 | | - $process->start($instance->getHandler(), $context->getInput(), $this->wfStartDeferred); |
107 | | - }; |
108 | | - |
109 | | - // Define Context for interceptors Pipeline |
110 | 93 | Workflow::setCurrentContext($context); |
111 | | - |
112 | | - // Run workflow handler in an interceptor pipeline |
113 | | - $this->services->interceptorProvider |
114 | | - ->getPipeline(WorkflowInboundCallsInterceptor::class) |
115 | | - ->with( |
116 | | - $starter, |
117 | | - /** @see WorkflowInboundCallsInterceptor::execute() */ |
118 | | - 'execute', |
119 | | - )( |
120 | | - new WorkflowInput( |
121 | | - $context->getInfo(), |
122 | | - $context->getInput(), |
123 | | - $context->getHeader(), |
124 | | - $context->isReplaying(), |
125 | | - ), |
126 | | - ); |
| 94 | + $process = new Process($this->services, $runId, $instance); |
| 95 | + $this->services->running->add($process); |
| 96 | + $resolver->resolve(EncodedValues::fromValues([null])); |
| 97 | + $process->initAndStart($context, $instance, $this->wfStartDeferred); |
127 | 98 | } |
128 | 99 |
|
129 | 100 | private function findWorkflowOrFail(WorkflowInfo $info): WorkflowPrototype |
|
0 commit comments