Imports LFSO83Lib Imports DocumentProcessor83 Imports Microsoft.VisualBasic Namespace WorkflowActivity.Scripting.ArchivoURI Public Class ArchivoURI Inherits SDKScriptClass83 Protected Overrides Sub Execute() 'Dim StrDireccionURI as String = "http://www.bcrp.gob.pe" 'Dim StrDestino as String = "\SEC - Contenedor\CONTENIDOS\GESTIÓN DE DIRECTORIO\En Proceso\URI" 'Dim StrOrigen as String = "C:\ProcesoLF\DireccionURI\URI.html" 'Dim StrCreacion as String = "C:\ProcesoLF\DireccionURI\CreaDireccionURI.bat" 'Dim StrEliminacion as String = "C:\ProcesoLF\DireccionURI\EliminaDireccionURI.bat" Dim StrDireccionURI as String = TokenReplace("%(Direccion URI)") Dim StrDestino as String = TokenReplace("%(Destino)") Dim StrOrigen as String = TokenReplace("%(Origen)") Dim StrCreacion as String = TokenReplace("%(Creacion)") Dim StrEliminacion as String = TokenReplace("%(Eliminacion)") Dim LgcError as Boolean = False Dim StrError as String = "NO" Dim LgcConexion as Boolean = False '---------------- Creación de archivo HTML en servidor WorkFlow --------------------- Dim StrComando as String = StrCreacion & " " & CHrw(34) & StrOrigen & CHrw(34) & " " & StrDireccionURI Dim objshell as Object = CreateObject("WScript.Shell") Try objShell.Run(StrComando, 0, True) Catch ex As System.Runtime.InteropServices.COMException LgcError = True end Try If LgcError = True StrError = "Error --> Comando DOS " & StrCreacion Else objShell = Nothing '------------------ Carga de documento al Laserfiche ------------------- ' Instantiates a new document importer. Dim DocImporter As New DocumentImporter ' Retrieves a document from the repository and assigns it to the document importer. Dim doc As LFDocument = Database.GetEntryByPath(StrDestino) DocImporter.Document = doc ' Imports an electronic file. Try DocImporter.ImportElectronicFile(StrOrigen) Catch ex As System.Runtime.InteropServices.COMException LgcError = True end Try If LgcError = True StrError = "Error --> Importación de archivo " & StrOrigen Else ' Cleans up unused handles. doc.Dispose() '--------------- Elimina de archivo HTML en servidor WorkFlow --------------------- StrComando = StrEliminacion & " " & Chrw(34) & StrOrigen & Chrw(34) objshell = CreateObject("WScript.Shell") Try objShell.Run(StrComando, 0, True) Catch ex As System.Runtime.InteropServices.COMException LgcError = True end Try If LgcError = True StrError = "Error --> Comando DOS " & StrEliminacion Else objShell = Nothing End If End If End if SetToken("%Error", StrError) End Sub End Class End Namespace