%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % File: process.db 6/24/2002 % This file is used by the business model simulator. :- multifile class/2. /******** % Provider_role/Receiver_role is only applicable to communication process process/10 process(Instance, Process/ID, Status, Priority, Begin_time/End_time, Time_cost, (Requestor/Requestor_type, Provider/Provier_type), Event, Precond, Action, Postcond). Process/ID = Process_name/Process_id, both are unique given by the BPM. Process_id is a shorthand reference. Status = created, triggered, executing, finished, suspended, reinstated, cancelled. Priority = high, medium, low Event = [true], or a list of triggers. Precond = [true], or a list of precond. Action = [true], or a list of actions. Postcond = [true], or a list of preconditions. Note: in the current implementation, each process may or may not have a trigger. process_status_list([created, triggered, finished, suspended, reinstated, cancelled]). core status: (may be more detailed) process_status(created, triggered). process_status(created, suspended). process_status(created, cancelled). process_status(triggered, finished). process_status(triggered, suspended). process_status(triggered, cancelled). process_status(suspended, reinstated). process_status(reinstated, triggered). ----------------------------------------------------------------------- event/7, event_occ/7: event(Instance, Event_type, Status, Priority, Begin_time/End_time, (Requester/Requester_type, Provider/Provider_type), Event_content). Status = received/[], - when the event arrives processed/ProcessID_list, - An event has been dealt with, after a process is finished, its ID is added to the list finished/ProcessID_list, - when reached the end-junction suspended/ProcessID_list, cancelled/ProcessID_list. A ProcessID is a variable, it is the ID of the process type. Event_content = list, the details about the event. This content is flexible and may content any information necessary. received -> processed received -> suspended received -> cancelled processed -> finalised processed -> finished processed -> suspended processed -> cancelled suspended -> reinstated reinstated -> processed ----------------------------------------------------------------------- issue/7, issue_occ/7: issue(Instance, Issue, Status, Priority, Begin_time/End_time, (Requester/Requester_type, Provider/Provider_type), Issue_content). Issue_content = list, the details about the issue. This content is flexible and may content any information necessary. An issue may turn into an event which triggers a process !! ***********************************************************************/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Process 1. process(Instance, 'Receive Customer Request'/1, created, Priority, Begin_time/End_time, 1, (Requester/Requester_type, edinburgh/pc_specification), [event_occ(Instance, customer_request_for_pc_specification, received/_, Priority, Begin_time/End_time, (Requester/Requester_type, Provider/Provider_type), Event_content) ], [true], [cond_action([not_exist(instance_of(Requester, customer))], [create(instance_of(Requester, customer))] ), create(instance_att(Requester, event, Instance)), create(instance_of(Instance, event)) ], [exist(instance_of(Requester, customer)), exist(instance_att(Requester, event, Instance)), exist(instance_of(Instance, event)) ] ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Process 2. % only process the event when it still needing processing, this % is the loop point. process(Instance, 'Post Technical Constraint'/2, created, Priority, Begin_time/End_time, 2, (Provider/Provider_type, Receiver/pc_specification), [event_occ(Instance, customer_request_for_pc_specification, processed/List, Priority, Begin_time/End_time, (Provider/Provider_type, Receiver/Receiver_type), Event_content) ], [true], [construct_issue(solve_technical_constraint, Event_content, New_issue_content), post_issue( (edinburgh/marketing, aberdeen/technology), New_issue_content), retrieve_issue(_Issue) ], [] ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % process 3 process(Instance, 'Receive Technical Solution'/3, created, Priority, Begin_time/End_time, 1, (Provider/Provider_type, edinburgh/pc_specification), [exist(issue_packet(Header, issue_occ(Instance, solve_technical_constraint, processed/List, Priority, Begin_time/End_time, (Provider/Provider_type, edinburgh/pc_specification), solution(Provider, _, _old, New, _diff )))), ], [true], [ cond_action([not_exist(instance_att(Instance, solution, _))], [create(instance_att(Instance, solution, New))]), cond_action([exist(instance_att(Instance, solution, _))], [update(instance_att(Instance, solution, New))]) ], [] ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % process 4 process(Instance, 'Check Cost'/4, created, Priority, Begin_time/End_time, 1, (Provider/Provider_type, Receiver/pc_specification), [exist(issue_packet(Header, issue_occ(Instance, solve_technical_constraint, processed/List, Priority, Begin_time/End_time, (Provider/Provider_type, edinburgh/pc_specification), solution(Provider, _, _old, New, _diff )))), ], [exist(instance_att(Instance, solution, Solution)), ], [calculate_total_cost(Solution, Total), check_cost_constraint(Solution, Total, Result), cond_action([equal(Result, true)], [update_event_status(Instance, finalised) ]) ], [] ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % process 5: report to customer process(Instance, 'Report to Customer'/5, created, Priority, Begin_time/End_time, 1, (Provider/Provider_type, Receiver/pc_specification), [event_occ(Instance, Event, finalised/List, Priority, %% p1 finished processing Begin_time/End_time, (Provider/Provider_type, Receiver/Receiver_type), Event_content) ], [true], [report('Report Back to Customer', event_occ(Instance, Event, finalised/List, Priority, %% p1 finished processing Begin_time/End_time, (Provider/Provider_type, Receiver/Receiver_type), Event_content) ) ], [] ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%