-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example of coordination in CML (#29)
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/cml/service-coordination-example/InsuranceClaimCoordination.cml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Example coordination of services between three Bounded Contexts. | ||
* | ||
*/ | ||
ContextMap { | ||
contains ClaimsManagement | ||
contains InsuranceManagement | ||
contains PaymentManagement | ||
|
||
ClaimsManagement <-> InsuranceManagement | ||
|
||
ClaimsManagement <-> PaymentManagement | ||
} | ||
|
||
BoundedContext ClaimsManagement { | ||
Application { | ||
|
||
Coordination SubmitValidClaimCoordination { | ||
ClaimsManagement::ClaimsApplicationService::submitClaim; | ||
InsuranceManagement::InsuranceApplicationService::checkInsurance; | ||
ClaimsManagement::ClaimsApplicationService::acceptClaim; | ||
PaymentManagement::PaymentApplicationService::performPayment; | ||
} | ||
|
||
Service ClaimsApplicationService { | ||
void submitClaim(@Claim claim); | ||
void acceptClaim(@Claim claim); | ||
} | ||
} | ||
|
||
Aggregate Claims { | ||
Entity Claim | ||
} | ||
} | ||
|
||
BoundedContext InsuranceManagement { | ||
Application { | ||
Service InsuranceApplicationService { | ||
void checkInsurance(@Claim claim); | ||
} | ||
} | ||
} | ||
|
||
BoundedContext PaymentManagement { | ||
Application { | ||
Service PaymentApplicationService { | ||
void performPayment(@Claim claim); | ||
} | ||
} | ||
} | ||
|