diff --git a/Example40_ApplicationProcess_partitioningLargeSchemaIntoSeparateSchemas.mp b/Example40_ApplicationProcess_partitioningLargeSchemaIntoSeparateSchemas.mp new file mode 100644 index 0000000000000000000000000000000000000000..38c2edccb15bd8554720fe9a5729e511818ba4db --- /dev/null +++ b/Example40_ApplicationProcess_partitioningLargeSchemaIntoSeparateSchemas.mp @@ -0,0 +1,57 @@ +/* Example40_ApplicationProcess_partitioningLargeSchemaIntoSeparateSchemas.mp + + An applicant submits application and needs to get it approved by +the bureaucratic chain of two officials. If the first official approves, +he forwards the application to the second official. Application is +approved only after it receives both approvals. Each official can +approve/reject the application or request it reworked and resubmitted. +Rework and resubmit events may be repeated several times. Each rejection +is final and cannot be followed by rework and resubmit events. + +*/ +SCHEMA Application_approval_process + +ROOT Applicant: + prepare_application + submit_application + (* rework + submit_application *) + ( application_is_approved | + application_is_rejected ); + +ROOT Official_1: + (+ receives_application_from_Applicant + (approves_and_forwards_to_Official_2 | + request_rework | + reject ) +) +BUILD{ ENSURE #reject <= 1; + +ENSURE FOREACH $r: reject #$$EVENT AFTER $r == 0; }; +COORDINATE $s: submit_application FROM Applicant, +$r: receives_application_from_Applicant FROM Official_1 +DO ADD $s PRECEDES $r; OD; + +ROOT Official_2: + (* receives_application_from_Official_1 + (approves_and_forwards_to_Applicant | + request_rework | reject ) *) +BUILD{ ENSURE #reject <= 1; +ENSURE FOREACH $r: reject #$$EVENT AFTER $r == 0; }; + +COORDINATE $s: approves_and_forwards_to_Official_2 FROM Official_1, +$r: receives_application_from_Official_1 FROM +Official_2 +DO ADD $s PRECEDES $r; OD; + +/*--- interactions with Applicant ---------*/ +COORDINATE $r: reject, /* this may come from several actors */ +$rr: application_is_rejected FROM Applicant +DO ADD $r PRECEDES $rr; OD; + +COORDINATE $r: request_rework, /* this may come from several actors */ +$rr: rework FROM Applicant +DO ADD $r PRECEDES $rr; OD; + +COORDINATE $a: approves_and_forwards_to_Applicant FROM Official_2, +$aa: application_is_approved FROM Applicant +DO ADD $a PRECEDES $aa; OD; \ No newline at end of file