Do not let any software impress you!

Only let it convince your intellect.
Slider img 1
Do not look for a business paradise!

It is a waste of time.
Slider img 2
Only yourself can push you uphill.

There is no easy road to prizes.
Slider img 3
Productivity is the name of the game.

And you have to conquer it.
Slider img 4
As long as you understand it,

you will start to build your know-how.
Slider img 5
We can help with that.

We have the tools and the method.
Slider img 6
Procedure : AU_SETUP_CONBUSMAIL_COORDINATOR

AutoScript

start_agent_info
   AgentName = "AU_SETUP_CONBUSMAIL_COORDINATOR"
   AgentDescr = "Importing Contacts Coordinator"
   PR_FNAME = "AU_SETUPCONTACTS_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 "Import Prototype XLS"
        
    id = SelectFrom("SELECT AU_DOC FROM AU_DOC WHERE (FILE_NAME='AU_IMPASS_PROT.XLS')")
        
    fname1 = "AU_IMPASS_PROT.XLS"
    fname2 = GetResourceDir()
    fname2 = strcat(fname2,"\",fname1)
    
    call CopyFileFromServer("Resource","Path",fname1,fname2,id)
                                
    call ShellExecute("open",fname2)
    
end_bpm_subactivity
start_bpm_subactivity "Import XLS"
    
    filepath = SelectFile("C:\")
    call ImportDataFromXLS(filepath,"Associates")
                        
    call message("Associates Imported")    
    
    call OpenFormTop("ptBrowse";"AU_USERS_B.FM";"QRY.DATA")

end_bpm_subactivity
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 "Setup Roles Permissions"
start_bpm_subactivity "Permissions"
    
    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_SETUPACCOCIATES_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_SETUPCONTACTS_E.FM","WORK.AU_REQUEST",1,expr)
    
end_bpm_subactivity
end_bpm_activity

start_bpm_activity "Setup Contacts"
start_bpm_subactivity "Process Form"
    
    rec = __params[1]
    expr = strcat(rec,"=AU_REQUEST")
    call OpenFormTop("ptEdit","AU_SETUPCONTACTS_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_SETUPCONTACTS_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_SETUPCONTACTS_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_SETUPCONTACTS_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 Contacts" , __activation_user , "" , 0 , rec_id )

     callwait bpm_assign_job ( "Import Contacts" , __activation_user , "" , 0 , rec_id )
     call bpm_kosmossetupcheck ( "AU-IMPORT-CONTACTS" )

     callwait bpm_assign_job ( "Import Businesses", __activation_user, "", 0, rec_id )
     call bpm_kosmossetupcheck ( "AU-IMPORT-BUSINESSES" )     

     callwait bpm_assign_job ( "Import Mail Accounts" , __activation_user , "" , 0 , rec_id )
     call bpm_kosmossetupcheck ( "AU-IMPORT-MAILACCOUNTS" )

     callwait bpm_assign_job ( "Synchronize Mail Boxes" , __activation_user , "" , 0 , rec_id )
     call bpm_kosmossetupcheck ( "AU-SETUP-MAILBOXES" )
     call bpm_kosmossetupcheck ( "AU_SETUP_CONBUSMAIL_COORDINATOR" )
     
end_action