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_MEETING_COORDINATOR

AutoScript

start_agent_info
   AgentName = "AU_MEETING_COORDINATOR"
   AgentDescr = "Meeting"
   AgentLanguage = ""
   __timer_interval = 0 {....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 "Meeting"
start_bpm_subactivity "Meeting Form"
    
    rec = __params[1]
    expr = strcat(rec,"=AU_CAL")
    call OnOpenForm_DisablePost()
    call OpenFormTop("ptEdit","AU_CAL0.FM","WORK.AU_CAL",1,expr)    
    
end_bpm_subactivity
end_bpm_activity

start_bpm_activity "New Meeting"
start_bpm_subactivity "Meeting Form"
    
    rec = __params[1]
    expr = strcat(rec,"=AU_CAL")
    call OpenFormTop("ptEdit","AU_CAL0.FM","WORK.AU_CAL",1,expr)    
    
end_bpm_subactivity
end_bpm_activity

start_bpm_activity "Meeting Invitation"
start_bpm_subactivity "Meeting Form"
    
    rec = __params[1]
    expr = strcat(rec,"=AU_CAL")
    call OnOpenForm_DisablePost()
    call OpenFormTop("ptEdit","AU_CAL0.FM","WORK.AU_CAL",1,expr)    
    
end_bpm_subactivity
start_bpm_subactivity "Confirm or Suggest"
    
    rec = __params[2]
    expr = strcat(rec,"=AU_CAL_USER")
    call OpenFormTop("ptEdit","AU_CAL_USER_E.FM","WORK.AU_CAL_USER",1,expr)    
    
end_bpm_subactivity
end_bpm_activity

start_bpm_activity "Meeting Confirmations"
start_bpm_subactivity "Meeting Form"
    
    rec = __params[1]
    expr = strcat(rec,"=AU_CAL")
    call OpenFormTop("ptEdit","AU_CAL0.FM","WORK.AU_CAL",1,expr)    
    
end_bpm_subactivity
end_bpm_activity

start_bpm_activity "Edit Meeting Resolutions"
start_bpm_subactivity "Meeting Form"
                
    rec = __params[1]
    expr = strcat(rec,"=AU_CAL")
    call OpenFormTop("ptEdit","AU_CAL0.FM","WORK.AU_CAL",1,expr)    
    
end_bpm_subactivity
end_bpm_activity

start_bpm_activity "Meeting Resolutions"
start_bpm_subactivity "Meeting Form"
    
    rec = __params[1]
    expr = strcat(rec,"=AU_CAL")    
    call OnOpenForm_DisablePost()
    call OpenFormTop("ptEdit","AU_CAL0.FM","WORK.AU_CAL",1,expr)    
    
end_bpm_subactivity
end_bpm_activity

start_action

    rec_id = __params[1]     { meeting id }
    comm = __params[2]     { subject }

    call bpm_setprocedurecomment(comm)                 {.....set the procedures comment}
    call bpm_setprocedureowner(__activation_user)     {.....set the procedure owner}
                                                        
    {.(1)...........................new meeting........................}
    call bpm_openatonce()                                                                                                
    callwait bpm_assign_job ( "New Meeting" , __activation_user , "" , 0 , rec_id )
    
    for j = 1 to 100                {.....repeat until meeting is launched!...}

       {.(2)...............send the meeting invitations...........}
       start_sql "*" "KOSMOS"
         SELECT AU_USER.UNAME, AU_CAL_USER.AU_CAL_USER
         FROM AU_CAL_USER INNER JOIN AU_USER ON AU_CAL_USER.AU_USER = AU_USER.AU_USER
         WHERE (AU_CAL_USER.AU_CAL = :M)
       end_sql
       q = QueryByName()
       call TSetParam(q,"M",rec_id)
       call TExecute(q)
       count = TRecordCount(q)
       call TFirst(q)
       for i = 1 to count

         meet_user_id = TGetFld(q,"AU_CAL_USER")
         uname        = TGetFld(q,"UNAME")

         call bpm_assign_job ( "Meeting Invitation" , uname , "" , 0 , rec_id, meet_user_id )

         call TNext(q)
       next
       call FreeEmbSQL(q)

       {.(3).................wait for cofirmations.....................}
       callwait bpm_assign_job ( "Meeting Confirmations" , __activation_user , "" , 0 , rec_id )

       call bpm_closeactivities("Meeting Invitation") {......set as closed/canceled all "Meeting Invitation" activities..}

       conf_flag = LookUpId("AU_CAL",rec_id,"CONFIRMED")
       cancel_flag = LookUpId("AU_CAL",rec_id,"CCANCELED")

       if (conf_flag = 1) or (cancel_flag = 1) then
         j = 100
       endif

    next {j = 100}

    if (conf_flag = 1) then {.....meeting is confirmed}

       {.(4).............create meeting appointments to all participant calendars..............}
       start_sql "*" "KOSMOS"
         SELECT AU_USER.UNAME, AU_CAL_USER.AU_CAL_USER
         FROM AU_CAL_USER INNER JOIN AU_USER ON AU_CAL_USER.AU_USER = AU_USER.AU_USER
         WHERE (AU_CAL_USER.AU_CAL = :M)
       end_sql
       q = QueryByName()
       call TSetParam(q,"M",rec_id)
       call TExecute(q)
       count = TRecordCount(q)
       call TFirst(q)

       mdate = LookUpId("AU_CAL", rec_id, "")
       mtime = LookUpId("AU_CAL", rec_id, "")
       mdur = LookUpId("AU_CAL", rec_id, "")

       for i = 1 to count

         meet_user_id = TGetFld(q,"AU_CAL_USER")
         uname[i] = TGetFld(q,"UNAME")

         call bpm_assign_job ( "Meeting" , uname[i] , "" , 0 , rec_id, meet_user_id )

         call TNext(q)
       next
       call FreeEmbSQL(q)

       {.....schedule automaticaly activities.........}
       call bpm_createactivitysched("Meeting", "", mdate, mtime, mdur )

       {.(5).................write resolutions....................}
       callwait bpm_assign_job ( "Edit Meeting Resolutions" , __activation_user , "" , 0 , rec_id )

       call bpm_closeactivities("Meeting") {......set as closed/canceled all "Meeting" activities..}

       {.(6).................share resolutions....................}
       split_for i = 1 to count

         callwait bpm_assign_job ( "Meeting Resolutions" , uname[i] , "" , 0 , rec_id )

       next_branch

       call UpdateTable ("AU_CAL", rec_id, "CDONE", "1" )

    endif

end_action