Automic Workload Automation

Expand all | Collapse all

User Interface configuration

  • 1.  User Interface configuration

    Posted 05-04-2016 01:24 PM
    I’m configuring and packaging the ONE Automation User Interface for the several hundred people who will use the program within the company. I have several goals with this effort:
    1. Provide a separate configuration of the UI for each of our Automation Engine systems — in other words, oneUI app for each environment(DEV, TEST, PROD).
    2. Configure the UI’s F1 help system so that it loadsdocumentation on docs.automic.com.
    3. Package the app so that it can be run through Microsoft App-V but still store user-specific configuration information and other data under the user’s home directory.
    I configured the UI’s ucdj.ini file to load the uc4config.xml file in the application directory, but to load/save the login_dat.xml in the user’s %TEMP% directory. This works very well.

    I am working on finding the best way to make the UI load the documentation file uc4_CSH.htm in a path relative to the application directory. I tried something like this:
            <docu type="hh">../docu</docu>
    It works when the app is run locally, but fails when the app is run via App-V. The ".." parent directory path is resolved in such a way that it contains spaces, and the web browser interprets the request to open the file as several separate requests instead of a single contiguous one. I’m going to try enclosing the path in double quotation marks:
            <docu type="hh">"../docu"</docu>
    I think that might fix the problem, and will provide an update here when I have had a chance to test it.

    Next, I have a bit of a challenge. I would like to be able to configure the UI so that it writes logs and traces to a subdirectory of the user’s %TEMP% directory. This way, each user’s UI logs and traces would be stored persistently, and in a common location regardless of on what computer the user runs the UI. I have found no way however to use any sort of variable like %TEMP% in the specification of the locations for logs and traces.
            <logging count="10">../temp/UCDJ_LOG_##.TXT</logging>
            <trace count="10" xml="0" tcp="0" ra="0">../temp/UCDJ_TRC_##.TXT</trace>
    Any ideas?


  • 2.  User Interface configuration

    Posted 05-06-2016 04:15 AM
    Hi,

    Regarding the last point the logging folder...

    I've checked the documentation and the support database, I haven't seen an official way to use variable.
    I've found a way but it might not be 100% supported <span>:smile:</span> :

    You can modify the file 
    UCDJ.bat. as follow:
    cd %USERPROFILE%
    java -Xmx1024m -XX:+UseG1GC -XX:MinHeapFreeRatio=40 -XX:MaxHeapFreeRatio=70 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\Automic\UserInterface\temp -Dsun.locale.formatasdefault=true -cp C:\Automic\UserInterface\bin;C:\Automic\UserInterface\bin\ucdj.jar com/uc4/ucdf/UCDialogFactory
    The 2 main points here:
    • cd to %USERPROFILE%
    • modify the command parameter -cp and specify the full path -cp C:\Automic\UserInterface\bin;C:\Automic\UserInterface\bin\ucdj.jar
    Then it should work if you launch the console UCDJ.bat

    Note: then the uc4config.xml should still contain the relative path.

    Regards,


  • 3.  User Interface configuration

    Posted 05-06-2016 04:52 AM
    Thanks, Didier. It's an interesting idea. The next challenge will be discovering and referencing the directory where the program itself resides. When the program is started via App-V, it is executed from a temporary directory whose path is not predictable.


  • 4.  User Interface configuration

    Posted 05-06-2016 05:18 AM
    Hi,

    At the beginning of the script you might then want to store the current location (I think it will be the location of the program)... then you can use the stored location to define the -cp

    I am not sure if it would work well with App-V however.

    Regards,


  • 5.  User Interface configuration

    Posted 05-06-2016 05:29 PM
    I tried using the following .BAT file to run the User Interface

    set UC4_ENV=DEV
    set PROG_DIR=%CD%
    set UC4_CONFIG_DIR=%USERPROFILE%\AppData\Roaming\UC4
    IF EXIST %UC4_CONFIG_DIR%\uc4config-%UC4_ENV%.xml (
         echo "Using UC4 UI config file for %UC4_ENV%: %UC4_CONFIG_DIR%\uc4config-%UC4_ENV%.xml."
         ) ELSE (
         echo "Copying UC4 UI config file for %UC4_ENV% (uc4config-%UC4_ENV%.xml) to %UC4_CONFIG_DIR%."
         xcopy /i %PROG_DIR%\..\config\uc4config-%UC4_ENV%.xml %UC4_CONFIG_DIR%
         )
    IF EXIST %UC4_CONFIG_DIR%\login_dat-%UC4_ENV%.xml (
         echo "Using UC4 login data file for %UC4_ENV%: %UC4_CONFIG_DIR%\login_dat-%UC4_ENV%.xml."
         ) ELSE (
         echo "Copying UC4 UI login data file for %UC4_ENV% (login_dat-%UC4_ENV%.xml) to %UC4_CONFIG_DIR%."
         xcopy /i %PROG_DIR%\..\config\login_dat-%UC4_ENV%.xml %UC4_CONFIG_DIR%
         )
    set JAVA_OPTIONS=-Xmx1024m -XX:+UseG1GC -XX:MinHeapFreeRatio=40 -XX:MaxHeapFreeRatio=70 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%UC4_CONFIG_DIR% -Dsun.locale.formatasdefault=true
    set JAVA_TOOL_OPTIONS=
    set UCDJ_OPTIONS=-U%USERNAME% -I%UC4_CONFIG_DIR%\uc4config-%UC4_ENV%.xml -O%UC4_CONFIG_DIR%\login_dat-%UC4_ENV%.xml
    set CLASSPATH=%PROG_DIR%;%PROG_DIR%\ucdj-%UC4_ENV%.jar
    cd %TEMP_DIR%
    javaw.exe %JAVA_OPTIONS% -cp %CLASSPATH% com/uc4/ucdf/UCDialogFactory %UCDJ_OPTIONS%

    The paths in the uc4config-DEV.xml file look like this:

    <docu type="wh">../docu</docu>
    <browser type="Mozilla Firefox">"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"</browser>
    <logging count="10">.\UCDJ_DEV_LOG_##.TXT</logging>
    <trace count="10" ra="0" tcp="0" xml="3">.\UCDJ_DEV_TRC_##.TXT</trace>

    The help function works fine. However, logs are written in the same directory as the ucdj program, not the current working directory set in the .BAT file.



  • 6.  User Interface configuration

    Posted 05-08-2016 01:59 AM
     
    ...
    <docu type="wh">../docu</docu>
    <browser type="Mozilla Firefox">"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"</browser>
    <logging count="10">.\UCDJ_DEV_LOG_##.TXT</logging>
    <trace count="10" ra="0" tcp="0" xml="3">.\UCDJ_DEV_TRC_##.TXT</trace>

    The help function works fine. However, logs are written in the same directory as the ucdj program, not the current working directory set in the .BAT file.

    My test suggests that the current working directory is overridden when the program starts, and is set to the directory where the program resides.

    It occurs to me that if it were possible to set the working directory to some other location prior to starting the app, it might then be difficult to load the help files from a path relative to the program directory.


  • 7.  User Interface configuration

    Posted 05-08-2016 06:48 AM
    Updated 2016.05.09 11:00 CET.

    I made some more alterations to my script and got it mostly working. Here is a summary of my findings.

    docu

    UCDJ reads documentation files from a path relative to the current working directory set using the cd command prior to launch, but this can be overriden by setting the user.dir Java system property, e.g.,
    -Duser.dir=%USERPROFILE%\AppData\Roaming\UC4
    A working directory set via the user.dir system property takes precedence over the current working directory set prior to launch using the cd command.
     

    logging / trace

    UCDJ writes logs and traces in a path relative to the current directory set using the cd command prior to launching the program, and ignores any working directory set via the user.dir Java system property.

    Updated uc4config & startup script

    With the benefit of this understanding, I modified the startup script and uc4config.xml files as follows.

    uc4config-DEV.xml (excerpt)
    <docu type="wh">../docu</docu>
    <browser type="Mozilla Firefox">"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"</browser>
    <logging count="10">UCDJ_DEV_LOG_##.TXT</logging>
    <trace count="10" xml="3" tcp="0" ra="0">UCDJ_DEV_TRC_##.TXT</trace>

    ucdj-DEV.bat
    set UC4_ENV=DEV
    set UC4_VER=9
    set PROG_DIR=%CD%
    set UC4_CONFIG_DIR=%USERPROFILE%\AppData\Roaming\UC4
    IF EXIST %UC4_CONFIG_DIR%\uc4config-%UC4_ENV%.xml (
         echo "Using UC4 UI config file for %UC4_ENV%: %UC4_CONFIG_DIR%\uc4config-%UC4_ENV%.xml."
         ) ELSE (
         echo "Copying UC4 UI config file for %UC4_ENV% (uc4config-%UC4_ENV%.xml) to %UC4_CONFIG_DIR%."
         robocopy %PROG_DIR%\..\config %UC4_CONFIG_DIR% uc4config-%UC4_ENV%.xml
         )
    IF EXIST %UC4_CONFIG_DIR%\login_dat-%UC4_ENV%.xml (
         echo "Using UC4 login data file for %UC4_ENV%: %UC4_CONFIG_DIR%\login_dat-%UC4_ENV%.xml."
         ) ELSE (
         echo "Copying UC4 UI login data file for %UC4_ENV% (login_dat-%UC4_ENV%.xml) to %UC4_CONFIG_DIR%."
         robocopy %PROG_DIR%\..\config %UC4_CONFIG_DIR% login_dat-%UC4_ENV%.xml
         )
    set JAVA_OPTIONS=
    set JAVA_TOOL_OPTIONS=-Xmx1024m -XX:+UseG1GC -XX:MinHeapFreeRatio=40 -XX:MaxHeapFreeRatio=70 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%UC4_CONFIG_DIR% -Dsun.locale.formatasdefault=true -Duser.dir=%PROG_DIR%
    set UCDJ_OPTIONS=-U%USERNAME% -I%UC4_CONFIG_DIR%\uc4config-%UC4_ENV%.xml -O%UC4_CONFIG_DIR%\login_dat-%UC4_ENV%.xml
    set CLASSPATH=%PROG_DIR%;%PROG_DIR%\ucdj-%UC4_ENV%.jar
    cd %UC4_CONFIG_DIR%
    javaw.exe -cp %CLASSPATH% com/uc4/ucdf/UCDialogFactory %UCDJ_OPTIONS%

    This script copies a defaultuc4config.xml andlogin_dat.xml file from the program directory to the user’s home directory if the user does not already have these files. It then launches UCDJ using the XML files in the user’s home directory.

    There are two important things to note here:

    1. Thecdcommand on the second-to-last line changes the current working directory to a subdirectory of the user’s home directory. This causes UCDJ to write logs and traces to a path relative to this directory.
    2. The-Duser.dir=%PROG_DIR%option in JAVA_TOOL_OPTIONS overrides the current working directory set using cd, and sets it back to the directory where the startup script resides. This causes UCDJ to read documentation files from a path relative to this directory.


  • 8.  User Interface configuration

    Posted 05-10-2016 04:41 AM
    Hi Michael,

    I'm quite impressed. So everything is working now, right?

    I feel that it might also help other user in the future.

    Regards,


  • 9.  User Interface configuration

    Posted 05-10-2016 06:05 AM
      |   view attached
    Didier Hoarau wrote:
    I'm quite impressed. So everything is working now, right?
    I feel that it might also help other user in the future.
    Yes, everything works fine. Yesterday I further improved the start-up script. The ucdj.bat script now accepts two parameters:
    • Automation Engine system/environment:
      EXP, EXP2, DEV, ITE, orPROD
    • Automation Engine version:
      9,11, or12(We do not use v10)
    In this way, I can package the ONE Automation User Interface in the same way for all configurations. To run a different version of the UI with a different set of configuration files, I can simply change the parameters passed to the script. The required files for each version are stored in separate subdirectories (see below).

    Our Automation Engine systems are currently running different versions:
      AE system  
      AE version  
    UC4 EXP
         v11.2.1.2  
      UC4 EXP2  
      v12 (development build)
    UC4 DEV
    v9sp11
    UC4 ITE
    v9sp11
    UC4 PROD
    v9sp11

    Depending on the parameters passed to it, the ucdj.bat script automatically copies the correct uc4config.xml and login_dat.xml files for the chosen AE system to the subdirectory of the user’s home directory; it sets the class path to the subdirectory containing the chosen version of the UI binaries; and then it runs the corresponding ucdj.jar. As before, the path to the log/trace directory is set just prior to execution using cd; and the path to the correct version of the stub HTML file for online documentation is set using the user.dir Java system property. Oh, one more thing: the JRE stdout/stderr are now redirected to a separate file (useful for Kerberos troubleshooting).

    Finally, I added a wrapper VBScript called uc4.vbs that calls the ucdj.bat file. This script validates the parameters passed to the script and executes the BAT file in a way that prevents the command window from appearing.

    With this set-up, I can create a shortcut that runs the UI for a particular AE system:
      Shortcut name  
      Target  
    UC4 EXP
         uc4.vbs EXP 11  
      UC4 EXP2  
      uc4.vbs EXP2 12
    UC4 DEV
    uc4.vbs DEV 9
    UC4 ITE
    uc4.vbs ITE 9
    UC4 PROD
    uc4.vbs PROD 9

    It works like a charm. Here is what the unified UI folder structure looks like:

    C:\UC4\UC4_UserInterface

    • UC4 EXP.lnk
    • UC4 EXP2.lnk
    • UC4 DEV.lnk
    • UC4 ITE.lnk
    • UC4 PROD.lnk
    • uc4.vbs
    • ucdj.bat
    • config
      • uc4config-PROD.xml
      • uc4config-ITE.xml
      • uc4config-EXP2.xml
      • uc4config-EXP.xml
      • uc4config-DEV.xml
      • login_dat-PROD.xml
      • login_dat-ITE.xml
      • login_dat-EXP2.xml
      • login_dat-EXP.xml
      • login_dat-DEV.xml
    • icons (ICO files for shortcuts)
    • jre_1.8.0_92 (JRE)
    • v9
      • bin
      • docu
    • v11
      • bin
      • docu
    • v12
      • bin
      • docu
    I have attached the new uc4.vbs script and the updated ucdj.bat scripts as a ZIP file.

    Attachment(s)



  • 10.  User Interface configuration

    Posted 05-10-2016 10:33 AM
    I have a quick update on the problem related to loading the F1 help when the app is run via App-V.

    When I try it, the browser opens with several tabs. The URLs of the tabs are:
    • file:///C:/Program
    • files
    • (x86)
    • UC4
    • dev
    • gui/docu/uc4/webhelp/english/uc4_CSH.htm#12
    It seems that the problem loading the correct help file is related to the way the path is constructed based on the current working directory. I assume this means that the current working directory when the app was launched was:
    C:\Program files (x86)\UC4 DEV GUI
    (The app I am testing in App-V was packaged before I developed the unified directory structure and special start-up scripts described above, so the working directory is not specifically set in a script prior to launch.)

    In any event, it seems that spaces in the path to the documentation are not handled well. With this in mind, I made one more modification to the ucdj.bat script. I changed this line:
    SET BAT_DIR=%CD%
    to:
    FOR /F "usebackq tokens=* delims=@" %%f IN (`"echo %CD%"`) DO SET BAT_DIR=%%~sf

    This setsBAT_DIR to the current working directory based on short file names (8.3 file names). The resulting URL sent to the browser should be something like:

    file:///C:/UC4/UC4USE~1/v11/docu/Guides/webhelp/english/help.htm#cshid=101
    At least when running the app locally, this works fine. Documentation loads correctly even when the app is installed in a path that contains spaces. This approach might resolve other potential problems caused by spaces in path names too.

    I will post an update here when I have had a chance to test this approach in App-V.


  • 11.  User Interface configuration

    Posted 05-12-2016 04:54 AM
    I have another quick update: writing stdout/stderr to a text file is a good idea, but I realized that I needed to make the file name unique. I added the AE environment and a date/time stamp to the file name. Here is the end of the ucdj.bat script:
    ...
    cd %UC4_CONFIG_DIR%
    for /f %%x in ('wmic path win32_localtime get /format:list ^| findstr "="') do set %%x
    REM pad 1-digit parts of date with leading zeros.
    set "Month=0%Month%"
    set "Month=%Month:~-2%"
    set "Day=0%Day%"
    set "Day=%Day:~-2%"
    set "Hour=0%Hour%"
    set "Hour=%Hour:~-2%"
    set "Minute=0%Minute%"
    set "Minute=%Minute:~-2%"
    set "Second=0%Second%"
    set "Second=%Second:~-2%"
    set datetime=%Year%.%Month%.%Day%_%Hour%.%Minute%.%Second%
    echo %datetime%
    %JAVA_DIR%\bin\javaw.exe -cp %CLASSPATH% com/uc4/ucdf/UCDialogFactory %UCDJ_OPTIONS% > %UC4_CONFIG_DIR%\UCDJ_%UC4_ENV%_%datetime%_stdout.txt 2>&1
    There’s probably a more elegant way to make a nicely-formatted date/time stamp. I’ll attach the updated scripts to comment 22444.


  • 12.  User Interface configuration

    Posted 05-19-2016 12:59 PM
    My plan to run the UI in this way just ran into a little snag. If the UC4 User Interface is started in such a way that the working directory is not writable by the user set using user.dir differs from the one set using cd, then in some cases, when the user attempts to display the Ftp tab of an RA FTP job, the UC4 User Interface will throw an exception as it tries and fails to write a temporary file.
    java.io.IOException: The system cannot find the path specified
         at java.io.WinNTFileSystem.createFileExclusively(Native Method)
         at java.io.File.createTempFile(File.java:2024)
         at com.uc4.be.tools.Base64JarClassLoader.<init>(Base64JarClassLoader.java:87)
         at com.uc4.be.tools.CITGuiClassLoader.<init>(CITGuiClassLoader.java:66)
         at com.uc4.be.guibuilder.screen.AbstractXmlListener.runGroovyCode(AbstractXmlListener.java:283)
         at com.uc4.be.guibuilder.screen.AbstractXmlListener.processCommonAction(AbstractXmlListener.java:239)
         at com.uc4.be.guibuilder.screen.XmlActionListener.actionPerformed(XmlActionListener.java:57)
         at com.uc4.be.guibuilder.screen.XmlReader.runInitActions(XmlReader.java:243)
         at com.uc4.ucdf.D.E.A(Unknown Source)
         at com.uc4.ucdf.D.E.<init>(Unknown Source)
         ...
    The working directory of the app cannot always be guaranteed to be user-writable. It seems that the User Interface portion of the RA FTP solution is trying to write temporary files in the current working directory. There can be circumstances in which this may not be possible. It would therefore probably be more prudent to ask the OS for the place to write temporary files, and to use this location consistently throughout the app. The java.io.tmpdir system property contains the OS-specific location for temporary files, e.g., %TEMP% on Windows, and /tmp on UNIX.

    This seems like a bug to me, so I reported it to Automic Support. I will provide and update here if the incident results in a problem ticket and planned fix.

    Update 1, 2016.05.20 10:00 CEST

    The problem is not as simple as whether the working directory is writable by the user. I ran some additional tests and discovered that the problem happens if the working directory set with user.dir is the UCDJ bin directory, and the working directory set with CD is any other directory.

    Working directory set with CDWorking directory set with user.dirResult
    UCDJ bin directoryUCDJ bin directory
    UCDJ bin directory%TEMP%\UC4
    UCDJ bin directory%USERPROFILE%\AppData\Roaming\UC4
    %TEMP%\UC4UCDJ bin directory
    %TEMP%\UC4%TEMP%\UC4
    %TEMP%\UC4%USERPROFILE%\AppData\Roaming\UC4
    %USERPROFILE%\AppData\Roaming\UC4UCDJ bin directory
    %USERPROFILE%\AppData\Roaming\UC4%TEMP%\UC4
    %USERPROFILE%\AppData\Roaming\UC4%USERPROFILE%\AppData\Roaming\UC4

    Update 2, 2016.05.26 9:20 CEST

    The problem is not limited to the RA FTP solution. All Rapid Automation solutions are impacted, including:
    • RA FTP
    • RA Informatica
    • RA Business Objects
    • RA Web Services
    • RA JMS
    In addition to the RA-specific tabs for RA jobs, the RA-specific tabs for RA agents exhibit the same symptom.


  • 13.  User Interface configuration

    Posted 05-27-2016 03:40 AM
      |   view attached
    I’m not optimistic that the problem will be fixed by Automic, so I have again reworked the ucdj.bat script to work around the problem. The script now copies three files prior to starting the program:
    • uc4config.xml
    • login_dat.xml
    • the stub help file:
      • v9: docu\uc4\webhelp\uc4_CSH.htm
      • v11: docu\guides\webhelp\help.htm
      • v12: docu\guides\webhelp\help.htm
    The script copies these files to a subdirectory of %USERPROFILE%\AppData\Roaming\UC4 based on the the environment name and version number. E.g.,%USERPROFILE%\AppData\Roaming\UC4\EXP\v11 if the script is started with the arguments ‘EXP 11’.

    The script then sets the current working directory — both with CD and via the user.dir Java system property — to this directory, and starts the UCDJ program.

    UC4.vbs

    Set objArgs = Wscript.Arguments
    numArgs = objArgs.Count
    ' WScript.Echo "Number of command line arguments: " & numArgs
    If numArgs <> 2 Then
         WScript.Echo "Usage: UC4.vbs <environment> <version>"
         WScript.Quit 1
    End If
    uc4Env = objArgs(0)
    uc4Env = UCase(uc4Env)
    uc4Ver = objArgs(1)
    Select Case uc4Env
         Case "EXP"
    '          WScript.Echo "UC4 Experimental (EXP) selected."
         Case "EXP2"
    '          WScript.Echo "UC4 Experimental 2 (EXP2) selected."
         Case "DEV"
    '          WScript.Echo "UC4 Development (DEV) selected."
         Case "ITE"
    '          WScript.Echo "UC4 Integrated Test Env. (ITE) selected."
         Case "PROD"
    '          WScript.Echo "UC4 Production (PROD) selected."
         Case Else
              WScript.Echo "Unknown UC4 environment: " & uc4Env
              WScript.Quit 1
    End Select
    Select Case uc4Ver
         Case "9"
    '          WScript.Echo "Version 9 selected."
         Case "11"
    '          WScript.Echo "Version 11 selected."
         Case "12"
    '          WScript.Echo "Version 12 selected."
         Case Else
              WScript.Echo "Unsupported UC4 version: " & uc4Ver
              WScript.Quit 1
    End Select
    Set oShell = CreateObject ("Wscript.Shell")
    Dim strArgs
    strArgs = "cmd /c ucdj.bat " & uc4Env & " " & uc4Ver
    oShell.Run strArgs, 0, false

    ucdj.bat

    REM Startup script for ONE Automation Java User Interface (UC4 GUI)
    set UC4_ENV=%1
    set UC4_VER=%2
    FOR /F "usebackq tokens=* delims=@" %%f IN (`"echo %CD%"`) DO SET BAT_DIR=%%~sf
    set PROG_DIR=%BAT_DIR%\v%UC4_VER%\bin
    set UC4_CONFIG_DIR=%USERPROFILE%\AppData\Roaming\UC4\%UC4_ENV%\v%UC4_VER%
    set JAVA_DIR=%BAT_DIR%\jre1.8.0_92
    rem ** Copy uc4config.xml file
    IF EXIST %UC4_CONFIG_DIR%\uc4config-%UC4_ENV%.xml (
         echo "Using UC4 UI config file %UC4_CONFIG_DIR%\uc4config-%UC4_ENV%.xml."
         ) ELSE (
         echo "Copying default UC4 UI config file for %UC4_ENV% (uc4config-%UC4_ENV%.xml) to %UC4_CONFIG_DIR%."
         robocopy %BAT_DIR%\config %UC4_CONFIG_DIR% uc4config-%UC4_ENV%.xml
         )

    rem ** Copy login_dat.xml file
    IF EXIST %UC4_CONFIG_DIR%\login_dat-%UC4_ENV%.xml (
         echo "Using UC4 login data file %UC4_CONFIG_DIR%\login_dat-%UC4_ENV%.xml."
         ) ELSE (
         echo "Copying default UC4 UI login data file for %UC4_ENV% (login_dat-%UC4_ENV%.xml) to %UC4_CONFIG_DIR%."
         robocopy %BAT_DIR%\config %UC4_CONFIG_DIR% login_dat-%UC4_ENV%.xml
         )

    rem ** Copy stub help file
    IF EXIST %UC4_CONFIG_DIR%\docu (
         echo "Using UC4 documentation stub html file under %UC4_CONFIG_DIR%\docu."
         ) ELSE (
         echo "Copying default UC4 documentation stub html file for UC4 v%UC4_VER% to %UC4_CONFIG_DIR%."
         robocopy %BAT_DIR%\v%UC4_VER%\docu %UC4_CONFIG_DIR%\docu /E
         )
    set JAVA_OPTIONS=
    set KRB5_DEBUG=-Dsun.security.krb5.debug=true
    set JAVA_TOOL_OPTIONS=-Xmx1024m -XX:+UseG1GC -XX:MinHeapFreeRatio=40 -XX:MaxHeapFreeRatio=70 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%UC4_CONFIG_DIR% -Dsun.locale.formatasdefault=true %KRB5_DEBUG% -Duser.dir=%UC4_CONFIG_DIR%
    set UCDJ_OPTIONS=-U%USERNAME% -I%UC4_CONFIG_DIR%\uc4config-%UC4_ENV%.xml -O%UC4_CONFIG_DIR%\login_dat-%UC4_ENV%.xml
    set CLASSPATH=%PROG_DIR%;%PROG_DIR%\ucdj-%UC4_ENV%.jar
    cd %UC4_CONFIG_DIR%
    for /f %%x in ('wmic path win32_localtime get /format:list ^| findstr "="') do set %%x
    REM pad 1-digit parts of date with a leading zero.
    set "Month=0%Month%"
    set "Month=%Month:~-2%"
    set "Day=0%Day%"
    set "Day=%Day:~-2%"
    set "Hour=0%Hour%"
    set "Hour=%Hour:~-2%"
    set "Minute=0%Minute%"
    set "Minute=%Minute:~-2%"
    set "Second=0%Second%"
    set "Second=%Second:~-2%"
    set datetime=%Year%.%Month%.%Day%_%Hour%.%Minute%.%Second%
    echo %datetime%
    %JAVA_DIR%\bin\javaw.exe -cp %CLASSPATH% com/uc4/ucdf/UCDialogFactory %UCDJ_OPTIONS% > %UC4_CONFIG_DIR%\UCDJ_%UC4_ENV%_%datetime%_stdout.txt 2>&1

    uc4config-DEV.xml (excerpt)

    <docu type="wh">docu</docu>
    <browser type="Mozilla Firefox">"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"</browser>
    <logging count="10">UCDJ_DEV_LOG_##.TXT</logging>
    <trace count="10" xml="3" tcp="0" ra="0">UCDJ_DEV_TRC_##.TXT</trace>
    The uc4config.xml files have all be updated to look for the documentation in the current working directory, rather than in its parent directory.

    When both working directories are set to the same subdirectory of %USERPROFILE%\AppData\Roaming\UC4, the problem with RA solution temporary files does not happen. (I will post a follow-up comment describing my findings regarding these temporary files.)

    Attachment(s)



  • 14.  User Interface configuration

    Posted 05-27-2016 04:39 AM
    I did a few more tests to try to determine how the UCDJ program determines where it writes temporary files for RA solutions. Here is what I learned.
    Working directory
    set with CD
    Working directory
    set with user.dir
    UCDJ writes RA solution temporary UI files to
    UCDJ writes RA solution
    temporary help files to
    UCDJ bin directoryUCDJ bin directory..\temp\RA%USERPROFILE%\.RA_Help
    %USERPROFILE%\AppData\Roaming\UC4%USERPROFILE%\AppData\Roaming\UC4%USERPROFILE%\.RA%USERPROFILE%\.RA_Help
    %TEMP%\UC4%TEMP%\UC4%USERPROFILE%\.RA%USERPROFILE%\.RA_Help
    C:\UC4C:\UC4%USERPROFILE%\.RA%USERPROFILE%\.RA_Help

    UI windows related to RA solutions (e.g., RA agent & job windows) have their own solution-specific tabs. Each RA solution is different, so these require additional code to be loaded before they can be displayed. (This explains why it can take some time to display an RA agent or RA job window the first time.) This code is downloaded from the Automation Engine, and cached locally in temporary UI JAR files on the machine where UCDJ is run. Once the UI JAR files for a particular RA solution have been cached, the UI is clever enough to know not to download them again.

    UI tabs related to an RA solution also have a Help button. The first time this help button is clicked for a particular RA solution, a JAR file containing the help files is downloaded. UCDJ always writes these help JAR files to %USERPROFILE%\.RA_Helpregardless of the current working directory. The names of these files are generated dynamically. The first RA solution help JAR file downloaded will be named help0.jar, the second one, help1.jar, and so on.

    Now, my hunch about the root of the problem...
    Different part of the UCDJ program appear to determine the current working directory differently. Some parts appear to pick it up from the directory set using CD, while other parts of the program appear to determine it from the user.dir system property. It seems likely that the problem I found arises from this inconsistent way of determining the current working directory, combined with the invalid assumption that the two will always be the same. When the working directory set via user.dir is the UCDJ bin directory, but the working directory set via CD is another directory, my guess is that  program performs one action using one of these directories, and then tries to perform a second action using the other directory. If for example, the program is writing the file in step 1 and then reading it in step 2, then if the directories used in the two steps differ, this could cause the problem.

    It would obviously be preferable if UCDJ were consistent in the way it determined the current working directory, throughout the program. And again, it might be better to determine the proper location for writing temporary files by reading the java.io.tmpdir system property.


  • 15.  User Interface configuration

    Posted 03-07-2017 02:06 PM

    Hello Michael,

    Is there a way to copy a file from a local desktop(user desktop) to a remote desktop(where the UC4 application is hosted)


    I tried using xcopy via windows job which runs in the remote desktop. But the issue is it cannot get hold of the file to be copied from the local desktop.

    Please let me know if there is a way out for this?

    Thanks,

    Arun



  • 16.  User Interface configuration

    Posted 03-07-2017 02:19 PM
    Arunendu_Ghosal_8994: I suggest you post your question to the main ONE Automation discussion forum.