An Activity is a manifestation of a particular task in the business logic.
Activities are defined as methods of a plain PHP interface annotated with
#[ActivityInterface] (you can use PHP 8 attributes
in PHP7 as well).
Each method defines a single Activity type. A single Workflow can use more than one Activity interface and call more that one Activity method from the same interface.
The only requirement is that Activity method arguments and return values are serializable to a byte array using the provided DataConverter interface. The default implementation uses a JSON serializer, but an alternative implementation can be easily configured.
Following is an example of an interface that defines four Activities:
We recommend to use a single value type argument for Activity methods. In this way, adding new arguments as fields to the value type is a backwards-compatible change.
#[ActivityMethod] annotation can be used to override a default Activity name.
ActivityInterface annotation will allow you to define your own prefix for all activity names (by
default it's empty).