Boa tarde pessoal
Eu tenho o seguinte código ADVPL:
#include "Totvs.ch"
User Function AFEWS04()
Local cTexto := ""
Local nX := 0
Local oWSDL
oWSDL := WSECMWorkflowEngineServiceService():New()
oWSDL:cusername := "dvasquez"
oWSDL:cpassword := "PASSWORD"
oWSDL:ncompanyId := 99
oWSDL:cprocessId := "solicitud_vacaciones" //solicitud de vacaciones
oWSDL:nchoosedState := 4 //inicio
oWSDL:ccomments := "Solictud de vacaciones via ERP"
oWSDL:cuserId := "dvasquez"
oWSDL:lcompleteTask := .T.
/*cardData*/
aAdd(oWSDL:oWSstartProcesscardData:oWSitem , {"desde","01/10/2020"} ) //nome campo, valor
aAdd(oWSDL:oWSstartProcesscardData:oWSitem , {"hasta","31/12/2020"} ) //nome campo , valor
oWSDL:lmanagerMode := .T. //como gestor del proceso es .T.
varinfo( "", oWSDL )
//startProcess(String user, String password, int companyId, String processId, int choosedState,
//String[] colleagueIds, String comments, String userId, boolean completeTask,
//ProcessAttachmentDto[] attachments, String[][] cardData, ProcessTaskAppointmentDto[] appointment,
//boolean managerMode)
oWSDL:startProcess( oWSDL:cusername,;
oWSDL:cpassword,;
oWSDL:ncompanyId,;
oWSDL:cprocessId,;
oWSDL:nchoosedState,;
oWSDL:oWSstartProcesscolleagueIds,;
oWSDL:ccomments,;
oWSDL:cuserId,;
oWSDL:lcompleteTask,;
oWSDL:oWSstartProcessattachments,;
oWSDL:oWSstartProcesscardData,;
oWSDL:oWSstartProcessappointment,;
oWSDL:lmanagerMode;
)
ConOut(WSDLDbgLevel(1))
Conout(GETWSCERROR(1))
ConOut(WSDLDbgLevel(2))
Conout(GETWSCERROR(2))
ConOut(WSDLDbgLevel(3))
Conout(GETWSCERROR(3))
MsgInfo("OK")
If Len( OWSDL:oWSstartProcessresult:OWSITEM ) = 1//Erro
MsgInfo("ERROR")
MsgInfo( OWSDL:oWSstartProcessresult:OWSITEM[1]:cItem[1] + " - " + OWSDL:oWSstartProcessresult:OWSITEM[1]:cItem[2] )
Else
For nX := 1 To Len( OWSDL:oWSstartProcessresult:OWSITEM )
cTexto += " - " + OWSDL:oWSstartProcessresult:OWSITEM[nX]:cItem[1] + ": " + OWSDL:oWSstartProcessresult:OWSITEM[nX]:cItem[2] + CRLF
Next nX
MsgInfo( cTexto )
EndIf
Return
Estou tentando consumir um serviço do webdesk / ECMWorkflowEngineService? Wsdl
Ao executar a fonte, ele tenta iniciar o processo, mas retorna o seguinte:
2020-10-01 12:40:34,240 INFO [com.totvs.technology.ecm.workflow.ws.WorkflowEngineService] (default task-401) Inicio de startProcess() iniciado... 2020-10-01 12:40:34,242 INFO [org.apache.cxf.phase.PhaseInterceptorChain] (default task-401) Application {http://ws.workflow.ecm.technology.totvs.com/}ECMWorkflowEngineServiceService#{http://ws.workflow.ecm.technology.totvs.com/}startProcess has thrown exception, unwinding now: java.lang.Exception: Campo cardData no tiene el campo y/o valor
indica que o campo cardData não possui o campo e / ou valor, Estou usando oWSDL: oWSstartProcesscardData para preencher as informações de cardData, mas não consigo preencher os campos do formulário. Alguém tem um exemplo de como iniciar um processo do fluig no protheus en Advpl?
Agradeço a ajuda.