File: eaf_n_cst_commitobject.sru
Size: 23729
Date: Tue, 22 Jan 2008 23:40:36 +0100
$PBExportHeader$eaf_n_cst_commitobject.sru
forward
global type eaf_n_cst_commitobject from n_cst_component
end type
end forward

global type eaf_n_cst_commitobject from n_cst_component
end type
global eaf_n_cst_commitobject eaf_n_cst_commitobject

type variables
Protected:
n_cst_updatemanager           inv_updatemanager
String                        is_referencetable
Long                          id[]
Boolean                       isvalid[]

end variables

forward prototypes
public function long commitend ()
public function long commitprepare ()
public function long commitstart ()
public function long commitvalidate ()
public function long rollbackend ()
public function long rollbackprepare ()
public function long rollbackstart ()
public function long rollbackvalidate ()
public function long commitmain ()
public function long rollbackmain ()
public function long commitreferencetable (integer mode)
public function long doopen (long commitid[])
public function integer updatestatus (string table, string status)
public function long dodelete (long commitid[])
public function long closemain ()
public function long closerollbackmain ()
public function long close (long closeid[])
public function integer closerollback (long closerollbackid[])
public function long docommit (long commitid[])
public function long dorollback (long commitid[])
public function long initializeupdatemanager ()
public function long setlanguageid (long al_languageid)
public function long setusername (string as_username)
end prototypes

public function long commitend ();return 1
end function

public function long commitprepare ();return 1
end function

public function long commitstart ();return 1
end function

public function long commitvalidate ();return 1
end function

public function long rollbackend ();return 1
end function

public function long rollbackprepare ();return 1
end function

public function long rollbackstart ();return 1
end function

public function long rollbackvalidate ();return 1
end function

public function long commitmain ();return 1
end function

public function long rollbackmain ();return 1
end function

public function long commitreferencetable (integer mode);constant string METHOD_NAME = "commitreferencetable ( )"

Long ll_ret, ll_row, ll_id[]
String ls_runtimeerror, ls_sql, ls_table, ls_where
n_datastore ldsobj
n_cst_helperservice lnvo_helper

try
   
   if is_referencetable = "" then return 0
      
   ls_table = ClassName(this)
   ls_table = Mid(ls_table, LastPos(ls_table, "_") + 1)
   ls_where = "("
   for ll_row = 1 to UpperBound(id)
      if ll_row > 1 then ls_where += ","
      ls_where += String(id[ll_row])
   next
   ls_where += ")"
   ls_sql = "select id from " + is_referencetable + " where " + ls_table + "_id in " + ls_where
   
   lnvo_helper = create n_cst_helperservice
   
   ldsobj = create n_datastore

   if lnvo_helper.datastorefromsql(ls_sql, ldsobj) = -1 then
      inv_messaging.append(lnvo_helper.inv_messaging )   
      return -1
   end if
   
   for ll_row = 1 to ldsobj.RowCount()
      ll_id[ll_row] = ldsobj.GetItemNumber(ll_row, "id")
   next
   
   if mode = 1 then
      ll_ret = inv_updatemanager.dostatus("commit", is_referencetable, ll_id)
   else
      ll_ret = inv_updatemanager.dostatus("rollback", is_referencetable, ll_id)
   end if
   
catch ( RuntimeError re )
   
   ls_runtimeerror = "Runtime Error:" + inv_constants.CRLF + inv_constants.CRLF
   ls_runtimeerror += "Error Code: " + string(re.number) + inv_constants.CRLF
   ls_runtimeerror += "Object: " + re.objectName + inv_constants.CRLF
   ls_runtimeerror += "Class: " + re.class + inv_constants.CRLF
   ls_runtimeerror += "Function/Event: " + re.routineName + inv_constants.CRLF
   ls_runtimeerror += "Line: " + string(re.line) + inv_constants.CRLF
   ls_runtimeerror += "Message: " + re.getMessage() + inv_constants.CRLF
   addError( METHOD_NAME, "Runtime Error: " + ls_runtimeerror)

   return -1
   
finally
   
   if IsValid(lnvo_helper) then destroy lnvo_helper
   
   if IsValid(ldsobj) then destroy ldsobj
   
end try

return 1
end function

public function long doopen (long commitid[]);constant string METHOD_NAME = "doopen ( commitid[] )"

String ls_runtimeerror, ls_table

try
   
   // Validate arguments
   If IsNull(commitid) or UpperBound(commitid) = 0 Then
      addError(METHOD_NAME, "Invalid commitid argument")
      Return -1   
   End If
   
   id = commitid
   
   ls_table = ClassName(this)
   ls_table = Mid(ls_table, LastPos(ls_table, "_") + 1)
   if ls_table = "" then
      this.addError(METHOD_NAME, "Invalid Table Name")
      return -1
   end if

   // Update Status
   if updatestatus(ls_table, "N") = -1 then 
      addError(METHOD_NAME, "commit Failed.  Failure in update status processing.")
      Return -1
   End if

catch ( RuntimeError re )
   
   ls_runtimeerror = "Runtime Error:" + inv_constants.CRLF + inv_constants.CRLF
   ls_runtimeerror += "Error Code: " + string(re.number) + inv_constants.CRLF
   ls_runtimeerror += "Object: " + re.objectName + inv_constants.CRLF
   ls_runtimeerror += "Class: " + re.class + inv_constants.CRLF
   ls_runtimeerror += "Function/Event: " + re.routineName + inv_constants.CRLF
   ls_runtimeerror += "Line: " + string(re.line) + inv_constants.CRLF
   ls_runtimeerror += "Message: " + re.getMessage() + inv_constants.CRLF
   addError( METHOD_NAME, "Runtime Error: " + ls_runtimeerror)

   return -1
   
finally

end try

Return 1
end function

public function integer updatestatus (string table, string status);////////////////////////////////////////////////////////////////
// Description:
//    Invoked by the Framework from the docommit().
//    Occurs when the commit is complete.
// Returns: 
//     1 - Success 
//    -1 - Failure - Fail the update status process

constant string METHOD_NAME = "updatestatus ( status )"

// Declare local variablesestatus
Long                    ll_row
String                  ls_status, ls_updatestatus

try
   
   ls_updatestatus = status
   
   if IsNull(ls_updatestatus) or Trim(ls_updatestatus) = "" then
      addError(METHOD_NAME, "Invalid status defined")
      return -1
   end if
   
   for ll_row = 1 to UpperBound(id)
      
      select status into :ls_status
         from misstatus
         where reference_table = :table
           and reference_id = :id[ll_row];
      if sqlca.sqlcode = 100 then ls_status = ""
      
      if ls_status = "" then
         INSERT INTO misstatus  ( reference_table, reference_id, status )  
           VALUES ( :table, :id[ll_row], :ls_updatestatus )  ;
         if sqlca.sqlcode <> 0 then
            addError(METHOD_NAME, "Execute sql:insert into misstatus failed! " + sqlca.sqlerrtext)
            return -1
         end if
         isvalid[ll_row] = true
      else
                  
         if ls_status = ls_updatestatus then
            isvalid[ll_row] = false
         else
            isvalid[ll_row] = true
            if ls_updatestatus <> ls_status then
               update misstatus set status = :ls_updatestatus
                  where reference_table = :table
                    and reference_id = :id[ll_row];
               if sqlca.sqlcode <> 0 then 
                  addError(METHOD_NAME, "Execute sql:update misstatus failed! " + sqlca.sqlerrtext)
                  return -1
               end if
            end if
         end if
      end if
      
   next
   
finally

end try

Return 1

end function

public function long dodelete (long commitid[]);constant string METHOD_NAME = "doopen ( commitid[] )"

String ls_runtimeerror, ls_table
Long ll_row

try
   
   // Validate arguments
   If IsNull(commitid) or UpperBound(commitid) = 0 Then
      addError(METHOD_NAME, "Invalid commitid argument")
      Return -1   
   End If
   
   id = commitid
   
   ls_table = ClassName(this)
   ls_table = Mid(ls_table, LastPos(ls_table, "_") + 1)
   if ls_table = "" then
      this.addError(METHOD_NAME, "Invalid Table Name")
      return -1
   end if
   
   for ll_row = 1 to UpperBound(id)
      delete from misstatus
            where reference_table = :ls_table
              and reference_id    = :id[ll_row];
      if sqlca.sqlcode <> 0 then
         addError(METHOD_NAME, "Execute sql:delete from misstatus failed! " + sqlca.sqlerrtext)
         return -1
      end if
   next
   
catch ( RuntimeError re )
   
   ls_runtimeerror = "Runtime Error:" + inv_constants.CRLF + inv_constants.CRLF
   ls_runtimeerror += "Error Code: " + string(re.number) + inv_constants.CRLF
   ls_runtimeerror += "Object: " + re.objectName + inv_constants.CRLF
   ls_runtimeerror += "Class: " + re.class + inv_constants.CRLF
   ls_runtimeerror += "Function/Event: " + re.routineName + inv_constants.CRLF
   ls_runtimeerror += "Line: " + string(re.line) + inv_constants.CRLF
   ls_runtimeerror += "Message: " + re.getMessage() + inv_constants.CRLF
   addError( METHOD_NAME, "Runtime Error: " + ls_runtimeerror)

   return -1
   
finally

end try

Return 1
end function

public function long closemain ();return 1
end function

public function long closerollbackmain ();return 1
end function

public function long close (long closeid[]);//  Description:
//    close processing
//
//    Contains Start and End processing
// Returns: 
//     1 - Success
//     0 - Nothing to close
//    -1 - Failure

constant string METHOD_NAME = "close ( closeid [] )"

// Declare local variables 
long                             ll_rc, ll_row
long                             ll_close_rc
string                           ls_errors
string                           ls_runtimeerror, ls_table
string                           ls_username
DateTime                         ldt_today
n_cst_helperservice              lnv_helperservice

try
   
   // Validate arguments
   If IsNull(closeid) or UpperBound(closeid) = 0 Then
      addError(METHOD_NAME, "Invalid closeid argument")
      Return -1   
   End If
      
   id = closeid
   
   ls_table = ClassName(this)
   ls_table = Mid(ls_table, LastPos(ls_table, "_") + 1)
   if ls_table = "" then
      addError(METHOD_NAME, "Invalid Table Name")
      return -1
   end if
   
   // Update Status
   if updatestatus(ls_table, "C") = -1 then 
      addError(METHOD_NAME, "close Failed.  Failure in update status processing.")
      Return -1
   End if

   // Invoke the closeMain processing method
   ll_close_rc = this.closeMain()
   If isNull(ll_close_rc) Or ll_close_rc <= 0 Then
      addError (METHOD_NAME, "close failed.  close failed in closeMain() processing." + sqlca.sqlerrtext)
      Return -1
   End If
   
   //update mistranslog
   lnv_helperservice = create n_cst_helperservice
   lnv_helperservice.servertime(ldt_today)
   destroy lnv_helperservice
   ls_username = GetUserName()
   for ll_row = 1 to UpperBound(closeid)
       INSERT INTO mistranslog  
         ( reference_table,   
           reference_id,   
           transtype,   
           userno,   
           moddate )  
        VALUES ( :ls_table,   
                 :closeid[ll_row],   
                 2,   
                 :ls_username,   
                 :ldt_today )  ;
      if sqlca.sqlcode <> 0 then
         addError(METHOD_NAME, "insert mistranslog table failed! " + sqlca.sqlerrtext)
         return -1
      end if
   next

   
catch ( RuntimeError re )
   
   ls_runtimeerror = "Runtime Error:" + inv_constants.CRLF + inv_constants.CRLF
   ls_runtimeerror += "Error Code: " + string(re.number) + inv_constants.CRLF
   ls_runtimeerror += "Object: " + re.objectName + inv_constants.CRLF
   ls_runtimeerror += "Class: " + re.class + inv_constants.CRLF
   ls_runtimeerror += "Function/Event: " + re.routineName + inv_constants.CRLF
   ls_runtimeerror += "Line: " + string(re.line) + inv_constants.CRLF
   ls_runtimeerror += "Message: " + re.getMessage() + inv_constants.CRLF
   addError( METHOD_NAME, "Runtime Error: " + ls_runtimeerror)

   return -1
   
finally

end try

Return ll_close_rc
end function

public function integer closerollback (long closerollbackid[]);// Description:
//    closerollback processing
//
//    Contains Start and End processing
// Returns: 
//     1 - Success
//     0 - Nothing to closerollback
//    -1 - Failure

constant string METHOD_NAME = "closerollback ( closerollbackid [] )"

// Declare local variables 
long                             ll_rc, ll_row
long                             ll_closerollback_rc
string                           ls_errors
string                           ls_runtimeerror, ls_table
string                           ls_username
DateTime                         ldt_today
n_cst_helperservice              lnv_helperservice

try
   
   // Validate arguments
   If IsNull(closerollbackid) or UpperBound(closerollbackid) = 0 Then
      addError(METHOD_NAME, "Invalid closerollbackid argument")
      Return -1   
   End If
      
   id = closerollbackid
   
   ls_table = ClassName(this)
   ls_table = Mid(ls_table, LastPos(ls_table, "_") + 1)
   if ls_table = "" then
      this.addError(METHOD_NAME, "Invalid Table Name")
      return -1
   end if
   
   // Update Status
   if updatestatus(ls_table, "Y") = -1 then 
      addError(METHOD_NAME, "closerollback Failed.  Failure in update status processing.")
      Return -1
   End if

   // Invoke the closerollbackMain processing method
   ll_closerollback_rc = this.closerollbackMain()
   If isNull(ll_closerollback_rc) Or ll_closerollback_rc <= 0 Then
      addError (METHOD_NAME, "closerollback failed.  closerollback failed in closerollbackMain() processing." + sqlca.sqlerrtext)
      Return -1
   End If
   
   //update mistranslog
   lnv_helperservice = create n_cst_helperservice
   lnv_helperservice.servertime(ldt_today)
   destroy lnv_helperservice
   ls_username = GetUserName()
   for ll_row = 1 to UpperBound(closerollbackid)
       INSERT INTO mistranslog  
         ( reference_table,   
           reference_id,   
           transtype,   
           userno,   
           moddate )  
        VALUES ( :ls_table,   
                 :closerollbackid[ll_row],   
                 3,   
                 :ls_username,   
                 :ldt_today )  ;
      if sqlca.sqlcode <> 0 then
         addError(METHOD_NAME, "update mistranslog table failed! " + sqlca.sqlerrtext)
         return -1
      end if
   next

   
catch ( RuntimeError re )
   
   ls_runtimeerror = "Runtime Error:" + inv_constants.CRLF + inv_constants.CRLF
   ls_runtimeerror += "Error Code: " + string(re.number) + inv_constants.CRLF
   ls_runtimeerror += "Object: " + re.objectName + inv_constants.CRLF
   ls_runtimeerror += "Class: " + re.class + inv_constants.CRLF
   ls_runtimeerror += "Function/Event: " + re.routineName + inv_constants.CRLF
   ls_runtimeerror += "Line: " + string(re.line) + inv_constants.CRLF
   ls_runtimeerror += "Message: " + re.getMessage() + inv_constants.CRLF
   addError( METHOD_NAME, "Runtime Error: " + ls_runtimeerror)

   return -1
   
finally

end try

Return ll_closerollback_rc
end function

public function long docommit (long commitid[]);// Description:
//    commit processing
//
//    Contains Start and End processing
// Returns: 
//     1 - Success
//     0 - Nothing to commit
//    -1 - Failure

constant string METHOD_NAME = "commit ( commitid [] )"

// Declare local variables 
long                             ll_rc, ll_row
long                             ll_start_rc
long                             ll_end_rc
long                             ll_commit_rc
string                           ls_errors
string                           ls_runtimeerror, ls_table
String                           ls_username
DateTime                         ldt_today
n_cst_helperservice              lnv_helperservice

try
   
   // Validate arguments
   If IsNull(commitid) or UpperBound(commitid) = 0 Then
      addError(METHOD_NAME, "Invalid commitid argument")
      Return -1   
   End If
   
   
   id = commitid
   
   ls_table = ClassName(this)
   ls_table = Mid(ls_table, LastPos(ls_table, "_") + 1)
   if ls_table = "" then
      this.addError(METHOD_NAME, "Invalid Table Name")
      return -1
   end if

   // Invoke the Start processing method
   ll_start_rc = this.commitStart()
   If ll_start_rc <= 0 Then 
      addError( METHOD_NAME, "commit failed!  commit was cancelled by commitStart processing." )
      Return -1
   End if
   
   // Perform the actual commit (skipped if ll_start_rc =2)
   If ll_start_rc = 1 Then
      
      // Update Status
      if updatestatus(ls_table, "Y") = -1 then 
         addError(METHOD_NAME, "commit Failed.  Failure in update status processing.")
         Return -1
      End if
      
      // Invoke the commitValidate processing method
      ll_rc = this.commitValidate()
      If ll_rc <= -1 Then 
         addError(METHOD_NAME, "commit Failed.  Failure in validation processing.")
         Return -1
      ElseIf ll_rc = 0 Then
         addError(METHOD_NAME, "commit Failed.  Validation criteria not met.")
         Return -1
      End if
      
      // Invoke the commitPrepare processing method
      ll_rc = this.commitPrepare()
      If ll_rc <= -1 Then 
         addError(METHOD_NAME, "commit failed.  Failure in commit prepare processing." + sqlca.sqlerrtext)
         Return -1
      ElseIf ll_rc = 0 Then
         Return -1   
      End if   

      // Invoke the commitMain processing method
      ll_commit_rc = this.commitMain()
      If isNull(ll_commit_rc) Or ll_commit_rc <= 0 Then
         addError (METHOD_NAME, "commit failed.  commit failed in commitMain() processing." + sqlca.sqlerrtext)
         Return -1
      End If
      
   End If   
   
   // Invoke the End processing method
   ll_end_rc = commitEnd()
   If ll_end_rc < 0 Then
      addError(METHOD_NAME, "commit failed!  commit was prevented by commitEnd processing." + sqlca.sqlerrtext)
      Return -1   
   End If
   
   //update mistranslog
   lnv_helperservice = create n_cst_helperservice
   lnv_helperservice.servertime(ldt_today)
   destroy lnv_helperservice
   ls_username = GetUserName()
   for ll_row = 1 to UpperBound(commitid)
       INSERT INTO mistranslog  
         ( reference_table,   
           reference_id,   
           transtype,   
           userno,   
           moddate )  
        VALUES ( :ls_table,   
                 :commitid[ll_row],   
                 1,   
                 :ls_username,   
                 :ldt_today )  ;
      if sqlca.sqlcode <> 0 then
         addError(METHOD_NAME, "update mistranslog table failed! " + sqlca.sqlerrtext)
         return -1
      end if
   next

   // Commit reference table
   ll_rc = commitreferencetable(1)
   If ll_rc < 0 Then
      addError(METHOD_NAME, "commit reference table failed! " + sqlca.sqlerrtext)
      Return -1   
   End If
   
catch ( RuntimeError re )
   
   ls_runtimeerror = "Runtime Error:" + inv_constants.CRLF + inv_constants.CRLF
   ls_runtimeerror += "Error Code: " + string(re.number) + inv_constants.CRLF
   ls_runtimeerror += "Object: " + re.objectName + inv_constants.CRLF
   ls_runtimeerror += "Class: " + re.class + inv_constants.CRLF
   ls_runtimeerror += "Function/Event: " + re.routineName + inv_constants.CRLF
   ls_runtimeerror += "Line: " + string(re.line) + inv_constants.CRLF
   ls_runtimeerror += "Message: " + re.getMessage() + inv_constants.CRLF
   addError( METHOD_NAME, "Runtime Error: " + ls_runtimeerror)

   return -1
   
finally

end try

Return ll_commit_rc
end function

public function long dorollback (long commitid[]);//  Description:
//    rollback processing
//
//    Contains Start and End processing
// Returns: 
//     1 - Success
//     0 - Nothing to rollback
//    -1 - Failure

constant string METHOD_NAME = "rollback ( REF s_mimedataset )"

// Declare local variables 
long                             ll_rc, ll_row
long                             ll_start_rc
long                             ll_end_rc
long                             ll_rollback_rc
string                           ls_errors
string                           ls_runtimeerror, ls_table
string                           ls_username
DateTime                         ldt_today
n_cst_helperservice              lnv_helperservice

try
   
   // Validate arguments
   If IsNull(commitid) or UpperBound(commitid) = 0 Then
      addError(METHOD_NAME, "Invalid commitid argument")
      Return -1   
   End If
   

   id = commitid

   ls_table = ClassName(this)
   ls_table = Mid(ls_table, LastPos(ls_table, "_") + 1)
   if ls_table = "" then
      this.addError(METHOD_NAME, "Invalid Table Name")
      return -1
   end if
   
   // Invoke the Start processing method
   ll_start_rc = this.rollbackStart()
   If ll_start_rc <= 0 Then 
      addError( METHOD_NAME, "rollback failed!  rollback was cancelled by rollbackStart processing." )
      Return -1
   End if
   
   // Perform the actual rollback (skipped if ll_start_rc =2)
   If ll_start_rc = 1 Then

      // Update Status
      if UpdateStatus(ls_table, "N") = -1 then 
         addError(METHOD_NAME, "commit Failed.  Failure in update status processing.")
         Return -1
      End if
      
      // Invoke the rollbackValidate processing method
      ll_rc = this.rollbackValidate()
      If ll_rc <= -1 Then 
         addError(METHOD_NAME, "rollback Failed.  Failure in validation processing.")
         Return -1
      ElseIf ll_rc = 0 Then
         addError(METHOD_NAME, "rollback Failed.  Validation criteria not met.")
         Return -1
      End if
      
      // Invoke the rollbackPrepare processing method
      ll_rc = this.rollbackPrepare()
      If ll_rc <= -1 Then 
         addError(METHOD_NAME, "rollback failed.  Failure in rollback prepare processing." + sqlca.sqlerrtext)
         Return -1
      ElseIf ll_rc = 0 Then
         Return -1   
      End if   
      
      // Invoke the rollbackMain processing method
      ll_rollback_rc = this.rollbackMain()
      If isNull(ll_rollback_rc) Or ll_rollback_rc <= 0 Then
         addError (METHOD_NAME, "rollback failed.  rollback failed in rollbackMain() processing." + sqlca.sqlerrtext)
         Return -1
      End If
      
   End If   
   
   // Invoke the End processing method
   ll_end_rc = rollbackEnd()
   If ll_end_rc < 0 Then
      addError(METHOD_NAME, "rollback failed!  rollback was prevented by rollbackEnd processing." + sqlca.sqlerrtext)
      Return -1   
   End If
   
   //update mistranslog
   lnv_helperservice = create n_cst_helperservice
   lnv_helperservice.servertime(ldt_today)
   destroy lnv_helperservice
   ls_username = GetUserName()
   for ll_row = 1 to UpperBound(commitid)
       INSERT INTO mistranslog  
         ( reference_table,   
           reference_id,   
           transtype,   
           userno,   
           moddate )  
        VALUES ( :ls_table,   
                 :commitid[ll_row],   
                 -1,   
                 :ls_username,   
                 :ldt_today )  ;
      if sqlca.sqlcode <> 0 then
         addError(METHOD_NAME, "Execute sql:insert mistranslog table failed! " + sqlca.sqlerrtext)
         return -1
      end if
   next

   // Rollback reference table
   ll_rc = commitreferencetable(-1)
   If ll_rc < 0 Then
      addError(METHOD_NAME, "commit reference table failed! " + sqlca.sqlerrtext)
      Return -1   
   End If

catch ( RuntimeError re )
   
   ls_runtimeerror = "Runtime Error:" + inv_constants.CRLF + inv_constants.CRLF
   ls_runtimeerror += "Error Code: " + string(re.number) + inv_constants.CRLF
   ls_runtimeerror += "Object: " + re.objectName + inv_constants.CRLF
   ls_runtimeerror += "Class: " + re.class + inv_constants.CRLF
   ls_runtimeerror += "Function/Event: " + re.routineName + inv_constants.CRLF
   ls_runtimeerror += "Line: " + string(re.line) + inv_constants.CRLF
   ls_runtimeerror += "Message: " + re.getMessage() + inv_constants.CRLF
   addError( METHOD_NAME, "Runtime Error: " + ls_runtimeerror)

   return -1
   
finally

end try

Return ll_rollback_rc
end function

public function long initializeupdatemanager ();if not IsValid(inv_updatemanager) then
   inv_updatemanager = create n_cst_updatemanager
   inv_updatemanager.inv_argument.addArgument( inv_constants.EAF_CHARACTER_SET_ARGUMENT_NAME, "ISO-8859-1" )
   inv_updatemanager.inv_argument.addArgument( inv_constants.EAF_INTERFACEMANAGER_COMPONENT_ARGUMENT_NAME, GetComponentName() )
   inv_updatemanager.inv_argument.addArgument( inv_constants.EAF_LANGUAGEID_ARGUMENT_NAME, String(GetLanguageID()) )
   inv_updatemanager.inv_argument.addArgument( inv_constants.EAF_USERID_ARGUMENT_NAME, GetUserName() )
end if

return 1
end function

public function long setlanguageid (long al_languageid);Super::SetLanguageid(al_languageid)

if IsValid(inv_objecthelper) then
   inv_objecthelper.SetLanguageid(al_languageid)
end if

return 1
end function

public function long setusername (string as_username);super::setusername(as_username)

if IsValid(inv_log) then
   inv_log.SetUserName(as_username)
end if

return 1
end function

on eaf_n_cst_commitobject.create
call super::create
end on

on eaf_n_cst_commitobject.destroy
call super::destroy
end on

event destructor;call super::destructor;if IsValid(inv_updatemanager) then
   destroy inv_updatemanager
end if
end event