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_PRODUCTS_COORDINATOR

AutoScript

start_agent_info
   AgentName = "AU_SETUP_PRODUCTS_COORDINATOR"
   AgentDescr = "Setup Products Coordinator"
   PR_FNAME = "AU_SETUPPRODUCTS_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')")
    
    fname1 = "AU_IMPMACC_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,"MAccounts")
                        
    call message("Associates Imported")    
        
    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_SETUPACCOCIATES_E.FM","WORK.AU_REQUEST",1,expr)
    
end_bpm_subactivity
end_bpm_activity

start_bpm_activity "Setup Businesses"
start_bpm_subactivity "Process Form"
    
    rec = __params[1]
    expr = strcat(rec,"=AU_REQUEST")
    call OpenFormTop("ptEdit","AU_SETUPBUSINESSES_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')")
        
    fname1 = "AU_IMPBUS_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,"Businesses")
                        
    call message("Businesses 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_SETUPBUSINESSES_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")

end_bpm_subactivity
start_bpm_subactivity "Process Form"
    
    rec = __params[1]
    expr = strcat(rec,"=AU_REQUEST")
    call OpenFormTop("ptEdit","AU_SETUPPRODUCTS_E.FM","WORK.AU_REQUEST",1,expr)
    
end_bpm_subactivity
end_bpm_activity

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

     callwait bpm_assign_job ( "Import Products" , __activation_user , "" , 0 , rec_id )
     call bpm_kosmossetupcheck ( "AU-IMPORT-PRODUCTS" )

     callwait bpm_assign_job ( "Import Products BOMs", __activation_user, "", 0, rec_id )
     call bpm_kosmossetupcheck ( "AU-IMPORT-PRODUCT-BOMS" )
     call bpm_kosmossetupcheck ( "AU_SETUP_PRODUCTS_COORDINATOR" )

end_action