Developing and Deploying Siebel eBusiness Applications > Creating a Virtual Business Component > Code Samples >

Code to Copy into Service:Service_PreInvokeMethod


Function Service_PreInvokeMethod (MethodName As String, Inputs As PropertySet, Outputs As PropertySet) As Integer

   Dim ParamText as String

'**********************************************************************************
'* SYSTEM DEFINITION SECTION
'*
'* The Calling V.BusComp must include the following parameters
'*
'* Service Name = Pal Mk2 (Unless Renamed)
'* Service Parameters = <Full Path & DataFile Name>;
'*       <No Of Columns in File>;
'*       <Columns in Calling VBC comma separated>
'*
'* e.g Service Parameters = c:\Siebel\Data.VBC;5;KeyId,FName,LName,Age,DOB
'*
'**********************************************************************************

' Identify the Context the Service is Called from and setup parameters

   VBCName = Inputs.GetProperty("Business Component Name")
   ParamText = me.GetProperty(VBCName)
   If ParamText <> "" Then
      DataSource = Left(ParamText,Instr(ParamText,";")-1)
      ParamText = Mid(ParamText,Instr(ParamText,";")+1)
      FieldCount = CVar(Left(ParamText,Instr(ParamText,";")-1))
      ColumnsReqd = Mid(ParamText,Instr(ParamText,";")+1)
   End If

' Handle the Method

   If MethodName = "Init" Then
      Pal_Init Inputs, Outputs
      Service_PreInvokeMethod = CancelOperation
   ElseIf MethodName = "Query" Then
      Pal_Query Inputs, Outputs
      Service_PreInvokeMethod = CancelOperation
   ElseIf MethodName = "Update" Then
      'Pal_Update Inputs, Outputs - Not Yet Completed
      Service_PreInvokeMethod = CancelOperation
   ElseIf MethodName = "PreInsert" Then
      Pal_PreInsert Outputs
      Service_PreInvokeMethod = CancelOperation
   ElseIf MethodName = "Insert" Then
      Pal_Insert Inputs, Outputs
      Service_PreInvokeMethod = CancelOperation
   ElseIf MethodName = "Delete" Then
      'Pal_Delete Inputs - Not Yet Completed
      Service_PreInvokeMethod = CancelOperation
   Else
      Service_PreInvokeMethod = ContinueOperation
   End If

End Function

Developing and Deploying Siebel eBusiness Applications