Long Running Processes
Using AutoScript in Mykosmos/BOS framework, we can build software (intelligent agents) that can support long-running processes. For example, we specialize every agent as “coordinator“ can keep his “code“ running for days or months. For example, see an agent‘s following “action code“ (from AutoServices demo application).
start_action
call bpm_setprocedureowner(__activation_user) {.....set the procedure owner}
{(1) any user can put a new service request}
callwait bpm_assign_job ( “new service request“ , __activation_user , ““ , 0)
serv_id = bpm_getrecid(1,__au_step) {......get the record id of the service request}
app_date = LookUp(“SERV“,“SERV“,serv_id,“ADATE“,““)
customer = LookUp(“SERV“,“SERV“,serv_id,“CUSTOMER“,““)
car_no = LookUp(“SERV“,“SERV“,serv_id,“CAR_NO“,““)
comm = strcat(customer,“ with car “,car_no)
call bpm_setprocedurecomment(comm) {.....set the procedures comment}
{(2) at date (app_date) the GATE SECURITY waits for the customer to come for the appointment}
app_date_num = DateToNum(app_date)
callwait bpm_assign_job ( “service appointment“ , ““ , “GATE SECURITY“ , app_date_num , erv_id )
{(3) the CHIEF MECHANIC makes the first estimation of labor and materials, assigns a mechanic}
callwait bpm_assign_job ( “service estimation“ , ““ , “CHIEF MECHANIC“ , 0 , serv_id )
disas_mechanic = LookUp(“SERV“,“SERV“,serv_id,“MECHANIC1“,““) {....disassemble mechanic}
reass_mechanic = LookUp(“SERV“,“SERV“,serv_id,“MECHANIC2“,““) {....reassemble mechanic}
{split activities at the same time, the warehouse prepares the materials,}
{ the mechanic starts working, the cafeteria hosts the customer}
split_in_branch {parallel split the technical department does the job while in}
split_in_branch {parallel split...(4) the warehouse prepares the required parts while ...}
callwait bpm_assign_job ( “collect parts“ , ““ , “WAREHOUSE“ , 0 , serv_id )
and_branch {(5).... the assigned mechanic disassembles the engine}
callwait bpm_assign_job ( “disassemble“ , disas_mechanic , ““ , 0 , serv_id )
join_branches
{(6) the assigned mechanic puts the parts and reassembles the engine}
callwait bpm_assign_job ( “reassemble“ , reass_mechanic , ““ , 0 , serv_id )
and_branch {(7) the cafeteria the customer takes a coffee}
callwait bpm_assign_job ( “host customer“ , ““ , “HOSTESS“ , 0 , serv_id )
join_branches { the customer finished their coffee and the job has done}
{(8) the customer goes to the office to pay}
callwait bpm_assign_job ( “payment and goodbye“ , ““ , “OFFICE“ , 0 , serv_id )
end_action
We can shut down the agency server as many times as we wish without losing the code (agent) any of his process information.