Jump to: navigation, search

Difference between revisions of "UBIK Enterprise Service"


Line 57: Line 57:
  
 
=== JSON Command ===
 
=== JSON Command ===
 +
Using this command file type {{UBIK}} EnterpriseService will start a UBIK.Console and pass the scripts defined in the command file as parameter:
 +
 +
<source lang="json">
 +
{
 +
"PathToUbikConsole": "...\\UBIK.Studio\\UBIK.Console.exe",
 +
"InitStatement": "...\\UBIK.Studio\\Scripts\\init.cs",
 +
"PathToScriptFile": "...\\UBIK.Studio\\Scripts\\script.cs",
 +
"ConfigFilePath": "...\\UBIK.Studio\\Scripts\\config.cs",
 +
"CommandFileAction": 2
 +
}
 +
</source>
  
 
== Configuring {{UBIK}} EnterpriseService ==
 
== Configuring {{UBIK}} EnterpriseService ==

Revision as of 19:49, 29 May 2019

The UBIK® Enterprise Service is a Windows service that is meant to automate UBIK® interface components or interface workflows.

Concept

The UBIK® EnterpriseService typically runs on a server and watches an arbitrary amount of folders in the file system for changes, like new or modified files. Once such a change occurs, it parses the file and checks if its extension matches the signature of a UBIK® command file. If true, it will be processed.

Command file

A command file for the UBIK® EnterpriseService is a plain text file and has the extension .command or ".json.command". When the EnterpriseService starts processing such a file, it will be parsed as an XML or JSON document. In the case of an XML document every non-XML information in the file will be ignored.

XML Command

A sample command file for starting an interface component looks like this:

<InterfaceManager>
  <Commands>
    <Interface FullName="UBIK.TEST, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" File="F:\Test\UBIK.TEST.dll" Class="UBIK.TestInterface" Direction="E">
      <Parameter Key="Server" Value="AUGLNZ0SQL" />
      <Parameter Key="InitialCatalog" Value="UBIK.Sandbox.Dev.V2" />
      <Parameter Key="UserID" Value="sa" />
      <Parameter Key="Password" Value="secretpassword123" />
      <Parameter Key="RecordLifeTime" Value="-1" />
      <Parameter Key="MyIFNeedsThis" Value="TestValue" />
    </Interface>
  </Commands>
</InterfaceManager>

This command file would attempt to instantiate the class UBIK.TestInterface from the assembly F:\Test\UBIK.TEST.dll. If connection succeeds, it will then invoke the the methods of the export interface, because of the setting Direction="E".

A sample command file for starting a workflow looks slightly different:

<InterfaceManager>
  <Commands>
    <Workflow Name="WF_XML_TEST" UID="5fdccb8c-85db-4dfc-861a-57be38267bfb" Async="False">
      <Parameter Key="Server" Value="AUGLNZ0SQL" />
      <Parameter Key="InitialCatalog" Value="UBIK.Sandbox.Dev.V2" />
      <Parameter Key="UserID" Value="sa" />
      <Parameter Key="Password" Value="secretpassword123" />
      <Parameter Key="RecordLifeTime" Value="-1" />
      <Parameter Key="MyWorkflowNeedsThis" Value="TestValue" />
    </Workflow>
  </Commands>
</InterfaceManager>

This command file would attempt to load the workflow object with the Guid 5fdccb8c-85db-4dfc-861a-57be38267bfb and invoke it synchronously, because of the setting Async="False".

IC Hint square.pngKeep UserID and Password empty, if you want the system to connect to the SQL Server using the Windows Authentication (https://msdn.microsoft.com/en-us/library/dd787978.aspx).
IC Hint square.pngIf the database server is on the same machine (localhost) then write Value="." for the server parameter.

Workflow Arguments

Every workflow started by the Enterprise Service needs an argument UBIKObject of data type UBIK.Kernel.BaseClass. The Enterprise Service initiates this default argument with the workflow object itself.

IC Attention.pngAny additional parameter, which is passed from the command file to the workflow, has to have an equivalent workflow argument as well.
IC Hint square.pngConfiguration files can of course be created and edited manually, but they can be more comfortably created using the Interface Manager

JSON Command

Using this command file type UBIK® EnterpriseService will start a UBIK.Console and pass the scripts defined in the command file as parameter:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, rails, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, spark, sparql, sql, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


{
	"PathToUbikConsole": "...\\UBIK.Studio\\UBIK.Console.exe",
	"InitStatement": "...\\UBIK.Studio\\Scripts\\init.cs",
	"PathToScriptFile": "...\\UBIK.Studio\\Scripts\\script.cs",
	"ConfigFilePath": "...\\UBIK.Studio\\Scripts\\config.cs",
	"CommandFileAction": 2
}

Configuring UBIK® EnterpriseService

Since Version 2.6.3 UBIK.EnterpriseService it is now possible to mark a command file as processed, delete a command file or do nothing once a command file is processed. This behaviour needs to be configured in the UBIK.EnterpriseService.exe.config configuration file. The following values are valid: Do Nothing = 0, Mark as processed with ".processed" = 1 and Delete = 2. The setting-key "ConsoleRunMode" defines whether UBIK.EnterpriseService will start the UBIK.Console either Normal = 0, Hidden = 1, Minimized = 2 or Maximized = 3.

<configuration>
  <appSettings>
    <add key="ConsoleRunMode" value="1" />
    <add key="CommandFileAction" value="0" />
  </appSettings>
</configuration>

Enterprise Service Task Execution Mode

For special cases the UBIK® EnterpriseService can be executed as a simple task. The reason to run it as a task can be for troubleshooting or for the case some referenced components cannot be run in service mode (e.g. Microsoft Office etc.). To be executed as a Task, the Enterprise Service .exe-File has to be started with the command line option "-tray". There will be a tray icon shown in the Windows Tray. Right-Clicking the tray icon opens the menu, where the user can start, stop, pause, or continue the enterprise service. Please note that starting the enterprise service as a task requires an active user session in order to be executed.



See also