Skip to content

Commit

Permalink
Cover Workflow:: methods with autocomplete rules
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Jan 17, 2025
1 parent ff03e78 commit 38129d7
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 13 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ composer require temporal/sdk
[![Stable Release](https://poser.pugx.org/temporal/sdk/version?style=flat-square)](https://packagist.org/packages/temporal/sdk)
[![Total DLoads](https://img.shields.io/packagist/dt/temporal/sdk.svg?style=flat-square)](https://packagist.org/packages/temporal/sdk/stats)
[![License](https://img.shields.io/packagist/l/temporal/sdk.svg?style=flat-square)](LICENSE.md)
[![Meta Storm Plugin](https://img.shields.io/static/v1?&style=flat-square&label=Powered+by&message=Meta+Storm+Plugin&logo=phpstorm&color=aa55ee)](#IDE-Plugin)

The SDK includes two main components: [Clients](https://docs.temporal.io/develop/php/temporal-clients) and Workers.
The Clients component is used to start, schedule, and manage Workflows;
Expand Down Expand Up @@ -137,8 +138,8 @@ Web UI will be available at `http://localhost:8000`.

### IDE Plugin

For advanced autocomplete while coding in IntelliJ IDEA, use the [Meta Storm plugin](https://github.com/xepozz/meta-storm-idea-plugin).
The plugin will suggest classes and Workflow names in the client methods.
For advanced autocomplete while coding in PHPStorm, use [Meta Storm plugin](https://github.com/xepozz/meta-storm-idea-plugin).
The plugin provides better autocomplete and links Workflow and Activity when writing and debugging code.

## Resources

Expand Down
14 changes: 3 additions & 11 deletions resources/.meta-storm.xml → resources/client.meta-storm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,23 @@
argument="0"
>
<collection name="temporal/sdk:workflow-type" argument="0" />
<stopCompletion />
</classMethod>
<classMethod
class="\Temporal\Client\WorkflowClientInterface"
method="newUntypedRunningWorkflowStub"
argument="2"
>
<collection name="temporal/sdk:workflow-type" argument="0" />
<stopCompletion />
</classMethod>
<classMethod
class="\Temporal\Client\WorkflowClientInterface"
method="newWorkflowStub"
argument="0"
>
<collection name="temporal/sdk:workflow-class" argument="0" />
<stopCompletion />
</classMethod>
</definitions>
<collections>
<attributeArgument
name="temporal/sdk:workflow-type"
class="\Temporal\Workflow\WorkflowMethod"
argument="0"
/>
<attributeClass
name="temporal/sdk:workflow-class"
class="\Temporal\Workflow\WorkflowInterface"
/>
</collections>
</meta-storm>
18 changes: 18 additions & 0 deletions resources/collections.meta-storm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta-storm xmlns="meta-storm">
<collections>
<attributeArgument
name="temporal/sdk:workflow-type"
class="\Temporal\Workflow\WorkflowMethod"
argument="0"
/>
<attributeClass
name="temporal/sdk:workflow-class"
class="\Temporal\Workflow\WorkflowInterface"
/>
<attributeClass
name="temporal/sdk:activity-class"
class="\Temporal\Activity\ActivityInterface"
/>
</collections>
</meta-storm>
69 changes: 69 additions & 0 deletions resources/workflow.meta-storm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<meta-storm xmlns="meta-storm">
<definitions>
<classMethod
class="\Temporal\Workflow"
method="continueAsNew"
argument="0"
>
<collection name="temporal/sdk:workflow-type" argument="0" />
<stopCompletion />
</classMethod>
<classMethod
class="\Temporal\Workflow"
method="newContinueAsNewStub"
argument="0"
>
<collection name="temporal/sdk:workflow-class" argument="0" />
<stopCompletion />
</classMethod>
<classMethod
class="\Temporal\Workflow"
method="executeChildWorkflow"
argument="0"
>
<collection name="temporal/sdk:workflow-type" argument="0" />
<stopCompletion />
</classMethod>
<classMethod
class="\Temporal\Workflow"
method="newUntypedChildWorkflowStub"
argument="0"
>
<collection name="temporal/sdk:workflow-type" argument="0" />
<stopCompletion />
</classMethod>
<classMethod
class="\Temporal\Workflow"
method="newChildWorkflowStub"
argument="0"
>
<collection name="temporal/sdk:workflow-class" argument="0" />
<stopCompletion />
</classMethod>
<classMethod
class="\Temporal\Workflow"
method="newExternalWorkflowStub"
argument="0"
>
<collection name="temporal/sdk:workflow-class" argument="0" />
<stopCompletion />
</classMethod>
<classMethod
class="\Temporal\Workflow"
method="executeActivity"
argument="0"
>
<collection name="temporal/sdk:activity-type" argument="0" />
<stopCompletion />
</classMethod>
<classMethod
class="\Temporal\Workflow"
method="newActivityStub"
argument="0"
>
<collection name="temporal/sdk:activity-class" argument="0" />
<stopCompletion />
</classMethod>
</definitions>
</meta-storm>

0 comments on commit 38129d7

Please sign in to comment.