Skip to content
Snippets Groups Projects
Commit 59234a83 authored by Keane Reynolds's avatar Keane Reynolds
Browse files

Uploaded example 40 from the manual

parent d2b4726b
No related branches found
No related tags found
4 merge requests!6Keane branch,!5Keane branch,!4Keane branch,!3Keane branch
/* 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment