(no subject)

Jun 20, 2007 19:17



01: Public Function NCStartProcessResponse(message As NotesDocument, applicationMessage As NotesDocument) As Integer
02: 'Обработка нескольких BD
03: '==============================================
04: Dim dbIndex As Integer
05: Dim database As NotesDatabase
06: '==============================================
07:
08: On Error Goto errorProcessingDB
09: For i = 1 To parameters.Responses.Count
10: dbIndex = 0
11: If parameters.Responses.GetNthDocument(i).ClassName(0)="com.nci.nc.transport.entity.Document" Then
12: Set document = parameters.Responses.GetNthDocument(i)
13: tag = document.Tag(0)
14:
15: 'Обработка нескольких BD
16: '==============================================
17: enotherDB: 'Тут сменяем базы в которых нужно искать документ
18: dbIndex = dbIndex + 1
19:
20: Select Case dbIndex
21: Case 1
22: Set database = outboxDB
23: Case 2
24: Set database = peopleDB
25: Case 3
26: Set database = dirordDB
27: Case Else
28: Print "В документе указан не верный UUID: " & tag
29: Goto stopProcessDocument
30: End Select
31: '==============================================
32:
33: Set outDocument = database.GetDocumentByUNID(tag)
34: outDocument.DocumentProcessID = process.ID
35: outDocument.DocumentGUID = document.ID
36: Call ChangeStatusTo(outDocument, "Processed")
37: Call outDocument.Save(True, False)
38:
39: 'Обработка нескольких BD
40: '==============================================
41: NCStartProcessResponse = 1 'Если хоть один документ обработался корректно засчитываем обработку
42: stopProcessDocument: 'Тут продолжаем перебор элементов массива
43: '==============================================
44: End If
45: Next
46:
47: ExitSub:
48: Exit Function
49: errorProcessingDB:
50: Resume enotherDB
51: End Function
Previous post Next post
Up