Skip to content

Instantly share code, notes, and snippets.

@SupaFuzz
Created October 5, 2022 19:37
Show Gist options
  • Save SupaFuzz/4acdf094693c6aac355b870d77065c50 to your computer and use it in GitHub Desktop.
Save SupaFuzz/4acdf094693c6aac355b870d77065c50 to your computer and use it in GitHub Desktop.
how to execute atrium integrator jobs from BMC ARSystem Workflow

Execute Atrium Integrator Jobs from ARSystem Workflow

you can create transformations in Atrium Integrator that can cleanly execute logic far beyond the capabililties of the most convoluted ARS "patch".

What's more you can then call these AI transformations (think "subroutines") from within ARS workflow!

Here's how. but first some notes

create UDM:Variables records first

YOU MUST create the UDM:Variable record PRIOR to creating the EXECUTION INSTANCE. This ... this is a bit of a problem. it infers that you CANNOT send arguments to AI runs without creating an entirely new ExecutionInstance, each and every time.

UDM:Variables records are immutable

you can't change the value of an existing variable then run it again it just keeps the old variable value. no joke. You MUST create a new execution instance every time (apparently), AND create your variables as they will be needed prior to making that execution instance.

UDM:Execution push-fields action cannot specify a query

when you use a push-fields action to push data onto UDM:Execution the action CANNOT specify search criteria (even something dumb like 1=0, it must be NULL). UDM::Execution is a vendor form that does not support query. Even though on any other kind of form a null query means "gimme everything" apparently this is the hacky way that ARS Deals with the lack of a query option on (certain?) vendor forms.

addendum (8/18/2015) I got it working!

if you use a filter to force attachment save on the arserver put the damn tick bang on it. Otherwise, it's gonna fire the damn AI job before it creates the file. note this applies to the old way of getting an attachment file into the AI job (writing it to the filesystem on the server then loading with file input. Newer AI versions allow you to query attachment fields direcrtly with the AR Input step.

OK, HERE'S HOW IT'S DONE

  1. create the transformation in Spoon, save it on the server, etc.

  2. Create an "Execution Instance"

as best I can tell, this is like a pointer or shell that points to the Transformation. These are stored in UDM:ExecutionInstance, however you can't create the record there directly, Mainly because it needs 'Atrium Integrator Engine Object ID' which is basically a GUID that Kettle (or BMCs code bolted onto it) uses to uniquely identify the AI "patch" you want to call. Since this is a vendor form, there's no other way to get that GUID than calling the plugin ... SO ...

2-a) create a record on UDM:Execution (vendor form)

  • 'Directory' (use the dropdown menu, this is the directory where you saved the thing in Spoon)
  • 'Type' ("Job" or "Transformation"), select this second so the next dropdown menu will work
  • 'Name' (use the drop down menu, find the thing you saved in 'Directory')
  • 'Object ID' (not strictly needed, but this is field '1' from UDM:Respository:Transoformation or UDM:Repository:Job)
  • 'Execution Instance Name' (anything unique. convention seems to be $Name$ + "_" + $Object ID$)
  • 'Log Level' (however ya want it)
  • 'Variable Set Name' (this is a GUID to glue your function calls to UDM:Variables entries, not really needed in this step)
  • 'Operation' (this is important: "Create Execution Instance")

2-b) well there really is no second step to this, but if you wanna verify that it worked look it up in UDM:ExecutionInstance afterward to make sure it dropped a record there for your new thing.

yeah ok, up to here, this has registered your new AI thing you wanna call

next up is the procedure for calling it

  1. Variables (if you have 'em) your AI Job or Transformation can define "Parameters" which are exactly what they sound like global variables you send into your job with values replaced at runtime. So: function arguments basically.

To do this, push values into UDM:Variable:

  • 'Name' this is the "name" of the Parameter in the Job or Transformation (think "key")

  • 'Value' this is value of the variable with 'Name' (this is the "value" for the "key", got it?)

  • 'Encrypted Value' No idea. The "documentation" says a non-null value on this field supersceedes a non-null value on 'Value' as to how, exactly, you're supposed to "encrypt" the value, and how in the heck AI would know how to "unencrypt" it, is completely missing from the documentation. Probably some sort of seed/hash mechanism, but who knows?

  • 'Created By' $USER$ oughta do it

  • 'Assignee Group Permissions' you know ... I dunno. "0;" probably would do it (not sure how exactly permissions are enforced here, it's all backend anyhow?)

  • 'Variable Set Name' (important) ... a GUID or something. But it's gotta be the same value you push onto UDM:Execution on the next step

  1. Execute that sucka! push values onto UDM:Execution (vendor form)

    • 'Directory' (use the dropdown menu, this is the directory where you saved the thing in Spoon)
    • 'Type' ("Job" or "Transformation"), select this second so the next dropdown menu will work
    • 'Name' (use the drop down menu, find the thing you saved in 'Directory'
    • 'Object ID' (not strictly needed, but this is field '1' from UDM:Respository:Transoformation or UDM:Repository:Job)
    • 'Execution Instance Name' (anything unique. convention seems to be $Name$ + "_" + $Object ID$)
    • 'Log Level' (however ya want it)
    • 'Variable Set Name' (this is a GUID to glue your function calls to UDM:Variables -- see above)
    • 'Operation' (this is important: "Start Execution Instance")

capturing exceptoions, exit status, etc

ok ... there's also probably a way to watch the various log forms (presuming you've got your AI thing set up to log to the forms in question) not really sure on this part yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment