Hello World,
I'm trying to update adTempus variables using ArticleID: K00000379.
Let's start with asking, is this the right way?
Purpose:
Read a file like:
XYEAR=2017
XMONTH=07
and create/update the adTempus variable permantly for a specified Group.
I created a new Script Library named 'SetVariables' like described.
When I create a Script, also as described, I get the following errors:
Message Number: ADT005066WMessage: Script compilation error: Namespace or type specified in the Imports 'ArcanaDevelopment.adTempus.Client' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. (BC40056) (Line 2, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'Scheduler' is not defined. (BC30002) (Line 16, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobVariable' is not defined. (BC30002) (Line 17, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobGroup' is not defined. (BC30002) (Line 18, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: 'ClassIDEnum' is not declared. It may be inaccessible due to its protection level. (BC30451) (Line 34, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobVariable' is not defined. (BC30002) (Line 34, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'Scheduler' is not defined. (BC30002) (Line 46, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobGroup' is not defined. (BC30002) (Line 46, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobGroup' is not defined. (BC30002) (Line 59, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobGroup' is not defined. (BC30002) (Line 60, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobGroup' is not defined. (BC30002) (Line 65, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobGroup' is not defined. (BC30002) (Line 65, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobGroup' is not defined. (BC30002) (Line 70, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobVariables' is not defined. (BC30002) (Line 79, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobVariable' is not defined. (BC30002) (Line 79, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobVariable' is not defined. (BC30002) (Line 80, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'Scheduler' is not defined. (BC30002) (Line 93, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'ServerSettings' is not defined. (BC30002) (Line 94, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'JobVariable' is not defined. (BC30002) (Line 95, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: 'ClassIDEnum' is not declared. It may be inaccessible due to its protection level. (BC30451) (Line 109, Column 0)****************************************
Message Number: ADT005066E
Message: Script compilation error: Type 'JobVariable' is not defined. (BC30002) (Line 109, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'Scheduler' is not defined. (BC30002) (Line 119, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'Application' is not defined. (BC30002) (Line 120, Column 0)****************************************
Message Number: ADT005066EMessage: Script compilation error: Type 'Application' is not defined. (BC30002) (Line 121, Column 0)****************************************
Message Number: ADT005074EMessage: Compilation of script library "SetVariables" failed. See previous messages for details.****************************************
Where did I go wrong?
The script I'm running looks like:
Imports SystemImports System.Collections.Generic
Imports ArcanaDevelopment.adTempus.SharedImports ArcanaDevelopment.adTempus.ApplicationIntegration
Imports System.IO
Imports System.Text.RegularExpressions
Public Class UserScript
Inherits ArcanaDevelopment.adTempus.ApplicationIntegration.UserScriptBase
Dim NewLine As Char = "\r\n"
Public Overrides Function Run() As Object
Dim FILE_NAME As String = adTempus.JobVariables("FileTrigger.FileName")
'check to make sure file exists
If Not File.Exists(FILE_NAME) Then
adtempus.LogMessage(MessageTypeEnum.Error, 0, "Trigger file niet gevonden: " & FILE_NAME) Return 8
End If
Dim TextLine As String
If System.IO.File.Exists( FILE_NAME ) = True Then
Dim objReader As New System.IO.StreamReader(FILE_NAME)
Do While objReader.Peek() <> -1
TextLine = objReader.ReadLine()
'adtempus.LogMessage(MessageTypeEnum.Error, 0, "Regel: " & TextLine)
Dim parts As String() = Nothing
parts = TextLine.Split("=")
Dim part As String
Dim lpsVar As String = String.Empty
Dim lpsVal As String = String.Empty
'adtempus.LogMessage(MessageTypeEnum.Error, 0, "----")
For Each part In parts
If (lpsVar.Length <> 0) Then lpsVal = part
If (lpsVar.Length = 0) Then lpsVar = part
Next part
SetGroupVariable("LPS\LPSGS17",lpsVar,lpsVal)
Loop
objReader.Close()
'Else
' MessageBox.Show("File Does Not Exist")
End If
Return 0
End Function
End Class
In another script like above , I use:
adTempus.JobVariables(lpsVar)= lpsVal
This does work, but then the variables are not stored permanently (are they?).
Help would be appreciated,
thank you very much
Kind regards,
Guy
the Netherlands