start_agent_info
AgentName = "AU_SETUP_GENERIC_COORDINATOR"
AgentDescr = "Setup Generic Coordinator"
PR_FNAME = "AU_SETUPGENERIC_E.FM"
PR_TNAME = "AU_REQUEST"
AgentLanguage = ""
__timer_interval = {....define
(in seconds
) the timer interval
for the wake up}
__delete_on_termination = 0 {....1=the agent frees itself
when terminates its task}
end_agent_info
start_bpm_activity "Setup Associates"
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPACCOCIATES_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Associates"
start_bpm_subactivity "Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPASS_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Associates"
)
call message
("Associates Imported"
)
call OpenFormTop
("ptBrowse";"
AU_USER_B01.FM";"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
call OpenFormTop
("ptBrowse";"
AU_USER_B01.FM";"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Setup Roles Permissions"
start_bpm_subactivity "Define Permissions and Departments"
call OpenFormTop
("ptBrowse";"
AU_POS_B01.FM";"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Mail Accounts"
start_bpm_subactivity "Import Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPMACC_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"MAccounts"
)
call message
("Mail Accounts Imported"
)
call OpenFormTop
("ptBrowse"
,"
AU_MAIL_POP3_B.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
call OpenFormTop
("ptBrowse"
,"
AU_MAIL_POP3_B.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Define Company"
start_bpm_subactivity "Company"
rec = __params[2]
expr = strcat
(rec
,"=AU_ORGAN_UNIT"
)
call OpenFormTop
("ptEdit"
,"
AU_ORGAN_UNIT_E.FM"
,"WORK.AU_ORGAN_UNIT"
,1
,expr
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Setup Organogram"
start_bpm_subactivity "Define Organogram"
call OpenOrganogramme
("setup"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Setup Standard Processes Roles"
start_bpm_subactivity "Standard Processes Roles"
call OpenFormTop
("ptBrowse";"
AU_ACTIVITY_B.FM";"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Contacts"
start_bpm_subactivity "Import Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPCONT_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Contacts"
)
call message
("Contacts Imported"
)
call OpenFormTop
("ptBrowse"
,"
AU_CONTBUSMAIL_B.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
call OpenFormTop
("ptBrowse"
,"
AU_CONTBUSMAIL_B.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Businesses"
start_bpm_subactivity "Import Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPBUS_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Businesses"
)
call message
("Businesses Imported"
)
call OpenFormTop
("ptBrowse"
,"
AU_ALLBUSINESSES.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
call OpenFormTop
("ptBrowse"
,"
AU_ALLBUSINESSES.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Synchronize Mail Boxes"
start_bpm_subactivity "Mail Accounts"
call OpenFormTop
("ptBrowse"
,"
AU_MAIL_POP3_B.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Products"
start_bpm_subactivity "Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPPROD_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Products"
)
call message
("Products Imported"
)
call OpenFormTop
("ptBrowse"
,"
AU_ALLPRODUCT_B.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
call OpenFormTop
("ptBrowse"
,"
AU_ALLPRODUCT_B.FM"
,"QRY.DATA"
,"ALL_MODE"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Products BOMs"
start_bpm_subactivity "Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPPRODBOM_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Productboms"
)
call message
("Product BOMs Imported"
)
call OpenFormTop
("ptBrowse";"
AU_PROD_RECIPIE_B.FM";"QRY.DATA"
,"ALL_MODE"
)
call OpenFormTop
("ptBrowse";"
AU_EQUIPMENT_SETUP_B.FM";"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
call OpenFormTop
("ptBrowse";"
AU_PROD_RECIPIE_B.FM";"QRY.DATA"
,"ALL_MODE"
)
call OpenFormTop
("ptBrowse";"
AU_EQUIPMENT_SETUP_B.FM";"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Protoypes"
start_bpm_subactivity "Organization Plan Project"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPPROJ_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Accosiates"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPASS_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Contacts"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPCONT_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Businesses"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPBUS_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Mail Accounts"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPMACC_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Products"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPPROD_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Price Lists"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPPRLST_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Bill Of Materials"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPPRODBOM_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Setup Generic"
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Assets Maintenance"
start_bpm_subactivity "Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPASSETMAINT_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Assetsmaints"
)
call message
("Assets Maintenance Imported"
)
call OpenFormTop
("ptBrowse";"
AU_PROD_RECIPIE_B.FM";"QRY.DATA"
,"ALL_MODE"
)
call OpenFormTop
("ptBrowse";"
AU_EQUIPMENT_SETUP_B.FM";"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
call OpenFormTop
("ptBrowse";"
AU_PROD_RECIPIE_B.FM";"QRY.DATA"
,"ALL_MODE"
)
call OpenFormTop
("ptBrowse";"
AU_EQUIPMENT_SETUP_B.FM";"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Organization Plan Project"
start_bpm_subactivity "Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPPROJ_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Projects"
)
call message
("Oragnization Plan Project Imported"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import Pricelist"
start_bpm_subactivity "Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPPRLST_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Pricelist"
)
call message
("Pricelist Imported"
)
call OpenFormTop
("ptBrowse"
,"
AU_ALLPRODUCT_B.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
call OpenFormTop
("ptBrowse"
,"
AU_ALLPRODUCT_B.FM"
,"QRY.DATA"
,"ALL_MODE"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Import PriceList"
start_bpm_subactivity "Prototype XLS"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPPRLST_PROT.XLS'
)"
)
call DocView
(id
)
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Pricelist"
)
call message
("Pricelist Imported"
)
call OpenFormTop
("ptBrowse"
,"
AU_ALLPRODUCT_B.FM"
,"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Imported Data"
call OpenFormTop
("ptBrowse"
,"
AU_ALLPRODUCT_B.FM"
,"QRY.DATA"
,"ALL_MODE"
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_REQUEST"
)
call OpenFormTop
("ptEdit"
,"
AU_SETUPGENERIC_E.FM"
,"WORK.AU_REQUEST"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_action
rec_id = __params[1]
comm = LookUpId
("AU_REQUEST"
,rec_id
,"SUBJECT"
)
call bpm_setprocedurecomment
(comm
)
call bpm_setprocedureowner
(__activation_user
)
call bpm_openatonce
()
callwait bpm_assign_job
( "Setup Generic"
, __activation_user
, ""
, 0
, rec_id
)
org_id = SelectFrom
("
SELECT AU_ORGAN_UNIT
FROM AU_ORGAN_UNIT"
)
org_id = val
(org_id
)
if (org_id = 0
) then
org_id = InsertInto
("AU_ORGAN_UNIT"
,"TITLE"
,"my company"
,""
)
endif
call bpm_addcheckpoint
( "Define Company"
, 1
)
call bpm_addcheckpoint
( "Import Protoypes"
, 1
)
call bpm_addcheckpoint
( "Import Organization Plan Project"
, 1
)
call bpm_addcheckpoint
( "Import Associates"
, 1
)
call bpm_addcheckpoint
( "Setup Organogram"
, 1
)
call bpm_addcheckpoint
( "Setup Roles Permissions"
, 1
)
call bpm_addcheckpoint
( "Setup Standard Processes Roles"
, 1
)
call bpm_addcheckpoint
( "Import Contacts"
, 1
)
call bpm_addcheckpoint
( "Import Businesses"
, 1
)
call bpm_addcheckpoint
( "Import Mail Accounts"
, 1
)
call bpm_addcheckpoint
( "Synchronize Mail Boxes"
, 1
)
call bpm_addcheckpoint
( "Import Products"
, 1
)
call bpm_addcheckpoint
( "Import PriceList"
, 1
)
call bpm_addcheckpoint
( "Import Assets Maintenance"
, 1
)
call bpm_addcheckpoint
( "Import Products BOMs"
, 1
)
callwait bpm_assign_job
( "Define Company"
, __activation_user
, ""
, 0
, rec_id
, org_id
)
call bpm_setcheckpoint
( "Define Company"
, 1
)
callwait bpm_assign_job
( "Import Protoypes"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import Protoypes"
, 1
)
callwait bpm_assign_job
( "Import Organization Plan Project"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import Organization Plan Project"
, 1
)
callwait bpm_assign_job
( "Import Associates"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import Associates"
, 1
)
callwait bpm_assign_job
( "Setup Organogram"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Setup Organogram"
, 1
)
callwait bpm_assign_job
( "Setup Roles Permissions"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Setup Roles Permissions"
, 1
)
callwait bpm_assign_job
( "Setup Standard Processes Roles"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Setup Standard Processes Roles"
, 1
)
{.............products......................}
callwait bpm_assign_job
( "Import Products"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import Products"
, 1
)
callwait bpm_assign_job
( "Import PriceList"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import PriceList"
, 1
)
callwait bpm_assign_job
( "Import Assets Maintenance"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import Assets Maintenance"
, 1
)
callwait bpm_assign_job
( "Import Products BOMs"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import Products BOMs"
, 1
)
{...............associates........................}
callwait bpm_assign_job
( "Import Contacts"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import Contacts"
, 1
)
callwait bpm_assign_job
( "Import Businesses"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import Businesses"
, 1
)
callwait bpm_assign_job
( "Import Mail Accounts"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Import Mail Accounts"
, 1
)
callwait bpm_assign_job
( "Synchronize Mail Boxes"
, __activation_user
, ""
, 0
, rec_id
)
call bpm_setcheckpoint
( "Synchronize Mail Boxes"
, 1
)
end_action