|
| 1 | +--- |
| 2 | +title: Microservice Domain Specific Language (MDSL) Orchestration Flows |
| 3 | +author: Olaf Zimmermann |
| 4 | +copyright: Olaf Zimmermann, 2021. All rights reserved. |
| 5 | +--- |
| 6 | + |
| 7 | +[Home](./index) — [Data Types](./datacontract) — [Bindings](./bindings) — [Provider and Client](./optionalparts) — [Tutorial](./tutorial) — [Cheat Sheet](./quickreference) — [Tools](./tools) |
| 8 | + |
| 9 | +Orchestration Flows |
| 10 | +=================== |
| 11 | + |
| 12 | +_Note:_ The status of these language concept is [*Experimental Preview*](https://microservice-api-patterns.org/patterns/evolution/ExperimentalPreview.html). The grammar and the tool support might change, in breaking ways, in future versions of MDSL. |
| 13 | + |
| 14 | +## Use Cases (When to Specify) |
| 15 | + |
| 16 | +* Rapid prototyping (for instance, of event storming results coming in from [Context Mapper](https://contextmapper.org/docs/application-and-process-layer/)) |
| 17 | +* API call sequencing |
| 18 | +* Integration flows, as input for middleware such as Apache Camel |
| 19 | + |
| 20 | +<!-- |
| 21 | +* Early SOAD |
| 22 | +* Application flows in inside a service |
| 23 | +* Service orchestration, API operation call sequencing |
| 24 | +* EIP-style integration flows (asynch., pipes and filters) |
| 25 | +* Testing (mocking, staging) |
| 26 | +--> |
| 27 | + |
| 28 | +## Grammar Excerpts |
| 29 | + |
| 30 | +This is an optional language concept. The flow grammar is subject to change as this is a technology preview. |
| 31 | + |
| 32 | +### Flow and flow steps (with technology binding) |
| 33 | + |
| 34 | +~~~ |
| 35 | +Orchestration: |
| 36 | + 'flow' name=ID |
| 37 | + ('realizes' scenario=[IntegrationScenario])? ('type' type=FlowType)? |
| 38 | + steps+=FlowStep* |
| 39 | + flowBinding=OrchestrationBinding? |
| 40 | +; |
| 41 | +~~~ |
| 42 | + |
| 43 | +~~~ |
| 44 | +enum FlowType: |
| 45 | + APPLICATION_FLOW |
| 46 | + | INTEGRATION_FLOW |
| 47 | + | SERVICE_ORCHESTRATION |
| 48 | + | API_CALL_SEQUENCING |
| 49 | + | EVENT_SOURCING |
| 50 | +; |
| 51 | +~~~ |
| 52 | + |
| 53 | +~~~ |
| 54 | +OrchestrationBinding: |
| 55 | + 'binding' /* 'flow' */ 'to' (eptb+=EndpointTypeBinding|cb+=ChannelBinding)+ |
| 56 | + ('implemented' 'as' ft=FlowTechnology)? |
| 57 | +; |
| 58 | +~~~ |
| 59 | + |
| 60 | +~~~ |
| 61 | +FlowTechnology: |
| 62 | + 'APACHE_CAMEL_ROUTE' | 'SPRING_INTEGRATION_FLOW' |
| 63 | + | 'BPMN_PROCESS' | 'BPEL_PROCESS' | 'YET_ANOTHER_FLOW_LANGUAGE' |
| 64 | + | 'PLAIN_PROGRAMMING' | STRING |
| 65 | +; |
| 66 | +~~~ |
| 67 | + |
| 68 | +### Event types and command types |
| 69 | + |
| 70 | +Only event types and command types that have been declared can be used in flows. The syntax for these declarations is similar to that of the [data types](./datacontract) used in endpoint contracts: |
| 71 | + |
| 72 | +~~~ |
| 73 | +EventTypes: |
| 74 | + 'event' 'type' events+=EventType (',' events+=EventType)* |
| 75 | +; |
| 76 | +
|
| 77 | +EventType: |
| 78 | + name=ID (content=ElementStructure)? // the domain data reported |
| 79 | + ('version' svi=SemanticVersioningIdentifier)? |
| 80 | +; |
| 81 | +
|
| 82 | +CommandTypes: |
| 83 | + 'command' 'type' commands+=CommandType (',' commands+=CommandType)* |
| 84 | +; |
| 85 | +
|
| 86 | +CommandType: |
| 87 | + name=ID (subject=ElementStructure)? // in/out data or business object/item |
| 88 | + ('version' svi=SemanticVersioningIdentifier)? |
| 89 | +; |
| 90 | +~~~ |
| 91 | + |
| 92 | +## Example |
| 93 | + |
| 94 | +This basic flow was actually generated from the [sample story scenario](./scenarios) with one of the quick fix [transformations](./soad.md) in the [MDSL tools](./tools.md). |
| 95 | + |
| 96 | +~~~ |
| 97 | +flow Scenario1Flow realizes Scenario1 |
| 98 | +event something_has_happened triggers command startProcess |
| 99 | +command startProcess emits event startProcessCompleted |
| 100 | +event CRUDSomeBusinessObjectTrigger triggers command CRUDSomeBusinessObject |
| 101 | +event startProcessCompleted triggers command startProcessCompletedProcessor |
| 102 | +command CRUDSomeBusinessObject emits event CRUDSomeBusinessObjectCompleted |
| 103 | +~~~ |
| 104 | + |
| 105 | +See section "Processes and Event/Command Flows" in the [CML language reference](https://contextmapper.org/docs/application-and-process-layer/) for explanations. |
| 106 | + |
| 107 | +<!-- TODO document more advanced features: binding, type, ... --> |
| 108 | + |
| 109 | +# Site Navigation |
| 110 | + |
| 111 | +* Language specification: |
| 112 | + * [Scenarios and stories](scenarios.md) |
| 113 | + * Service [endpoint contract types](./servicecontract) (this page) and [data contracts (schemas)](./datacontract) |
| 114 | + * [Bindings](./bindings) and [instance-level concepts](./optionalparts) |
| 115 | +* [Quick reference](./quickreference), [tutorial](./tutorial) and [tools](./tools) |
| 116 | +* [MDSL homepage](./index) |
| 117 | + |
| 118 | +*Copyright: Olaf Zimmermann, 2018-2021. All rights reserved. See [license information](https://github.com/Microservice-API-Patterns/MDSL-Specification/blob/master/LICENSE).* |
| 119 | + |
| 120 | +<!-- *EOF* --> |
0 commit comments