пустой getParameterDocID

vited

Green Team
17.11.2010
51
1
BIT
0
Добрый день.

По не понятной причине перестал работать агент на сервере из-за того, что getParameterDocID всегда пустой, хотя значение передается.
Вызывающий агента код выполняется на разных клиентах. Эффект одинаковый. Кто-нибудь с таким сталкивался?
Параметры агента:
Trigger: Agent list selection
Target: None
Shared + Allow restricted operations

Я создал с нуля тестовую БД (Сервер Domino 9)
Создал три агента, эффект тот же.
Код:
Sub Initialize
    Dim ns As New NotesSession, doc As NotesDocument, db As NotesDatabase
    Dim na As NotesAgent, PrfDoc As NotesDocument, s As String
    Set db = ns.CurrentDatabase
    Set Doc = db.Unprocesseddocuments.GetFirstDocument
    Set na = ns.CurrentDatabase.GetAgent("qq3")
    Print "qq1 Universalid: " + Doc.Universalid
    s = Doc.NoteID
    Print "qq1 NoteID: " + s
    Print "qq3: " & na.RunOnServer(s)
    Set na = ns.CurrentDatabase.GetAgent("qq2")
    Print "qq2: " & na.RunOnServer(s)
End Sub
qq2:
Код:
    public void NotesMain() {
      try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();
          Agent agent =  agentContext.getCurrentAgent();
          String s = agent.getParameterDocID();
          System.out.println("java getParameterDocID: " + s + " len: " + s.length());
          Document PrfDoc = session.getCurrentDatabase().getDocumentByID(s);
          System.out.println("Universalid: " +  PrfDoc.getUniversalID());
      } catch(Exception e) {
          e.printStackTrace();
       }
   }
qq2:
Код:
Sub Initialize
    On Error GoTo lbErr
    Dim ses As New NotesSession, s As String
    Dim db As NotesDatabase, ag As NotesAgent, doc As NotesDocument
    Set db = ses.CurrentDatabase
    Set ag = ses.CurrentAgent
    s = ag.ParameterDocID
    Print db.Filepath + " ParameterDocID: " + s + " len: " + Len(s)
    Set doc = db.GetDocumentByID(s)
    Print doc.Universalid
    Exit Sub
lbErr:
    Print "Error in " & GetThreadInfo(1)  & " Line: " & Erl & " Number: " & Err & " Error: " & Error$
    End
End Sub
Локально:
1619883407485.png

В консоле сервера:
Код:
01.05.2021 21:55:02   Agent printing: Test\Test.nsf ParameterDocID:  len: 0
01.05.2021 21:55:02   Agent printing: Error in INITIALIZE Line: 9 Number: 4270 Error: Invalid note id
01.05.2021 21:55:02   Agent printing: java getParameterDocID:  len: 0
01.05.2021 21:55:02   Agent  error: NotesException: A required argument has not been provided
01.05.2021 21:55:02   Agent  error:     at lotus.domino.local.Database.NgetDocumentByID(Native Method)
01.05.2021 21:55:02   Agent  error:     at lotus.domino.local.Database.getDocumentByID(Unknown Source)
01.05.2021 21:55:02   Agent  error:     at JavaAgent.NotesMain(Unknown Source)
01.05.2021 21:55:02   Agent  error:     at lotus.domino.AgentBase.runNotes(Unknown Source)
01.05.2021 21:55:02   Agent  error:     at lotus.domino.NotesThread.run(Unknown Source)
 

NetWood

Lotus Team
17.04.2008
565
96
BIT
174
Попробуйте так
Код:
Dim ns As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = ns.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()
 

savl

Lotus Team
28.10.2011
2 624
314
BIT
488
А документ сохранен?
Агент при выставлении Target: None может хватать документ открытый в UI.
у qq2 тоже None стоит?
 

vited

Green Team
17.11.2010
51
1
BIT
0
Отбой. Оказывается админ, не уведомив меня, попытался установить фикспак на сервер, и что-то пошло не так. И сейчас это вообще 9.0.1 без единого фикспака. Думаю дело в этом. Завтра всё переустановим и надеюсь всё будет работать как и раньше.
 
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!