summaryrefslogtreecommitdiff
path: root/tests/temporal/Workflow/WithChildWorkflow.php
blob: aac0979b73681f647ed09f8a470f850871936624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

declare(strict_types=1);

namespace Temporal\Tests\Workflow;

use Temporal\Workflow;
use Temporal\Workflow\WorkflowMethod;

#[Workflow\WorkflowInterface]
class WithChildWorkflow
{
    #[WorkflowMethod(name: 'WithChildWorkflow')]
    public function handler(
        string $input
    ): iterable {
        $result = yield Workflow::executeChildWorkflow(
            'SimpleWorkflow',
            ['child ' . $input],
            Workflow\ChildWorkflowOptions::new()
        );

        return 'Child: ' . $result;
    }
}