Search

AIFs – Simplifying their creation via automation

Since the inception of the BMC Service Request Management solution, there has been the concept of AIFs (Advanced Interface Forms) that allow for creating service requests as complicated and feature rich as required when the ‘simple’ wizard based service requests simply don’t cut it.  Over the years, more and more capabilities have been added to the ‘simple’ service requests to reduce some of the needs for AIFs but there are still some key lacking capabilities that still require us to build AIFs.  Some examples that most organizations run into are things like procurement or new hire requests where there is a ton of details that need to be gather and sometimes in a 1:N fashion that requires tables fields, support forms, complex validation workflow etc.

Now creating AIFs have always been above and beyond what we could call simple, unlike the simple ‘wizard’ based service requests that don’t actually require any actual Remedy workflow to be developed, creating a working AIF requires a bit of elbow grease and essentially is remedy app-dev using some boilerplate objects.  Luckily, BMC includes templates that can be used as starting points but even with those to simply create your own version has some initial annoyances as well as some repetitive workflow requirements that must be done as part of your AIFs boilerplate before you can actually start molding it in your image.

The steps involved in the above have been well documented in the SRM documentation as well as in posts such as the following: https://communities.bmc.com/community/bmcdn/bmc_remedy_ondemand/blog/2013/12/05/the-pulse-using-advanced-interface-form-aif-to-streamline-operations

As well as the steps and procedure is documented, when you have to create many AIFs it can be a very tedious endeavor, and that first one is the worst of them all as the need to overlay hundreds of pieces of workflow the first time can be heartbreaking (some workarounds exist, e.g.: https://communities.bmc.com/message/274872#274872 and Ideas published asking to improve the situation https://communities.bmc.com/ideas/4954).  There should be an easier way for all this but unfortunately at the time of writing this there really isn’t so I decided to try and put in a stop-gap until this process is made more streamlined by BMC.

Let’s review at a high level what we need to do to make this a seamless process:

  1. We need to be able to make a copy of an AIF to be used as a template for our new AIF (shouldn’t be limited to just the BMC provided samples)
  2. We need to be able to give our new AIF a name and a title as well as register it in the appropriate SRM configuration form
  3. We need to be able to automatically overlay the required remedy objects (if required) and then add new the AIF as a related form (except for some specific ones) to the overlaid objects
  4. We need to be able to make copies of specific workflow excluded from step 3 and make it relevant to us and then add it in the appropriate place in the appropriate guides

With the above functional requirements, building a utility to automate all of it really isn’t that difficult and a lot of what is needed to make this work I’ve already published in my Replicating Save-As functionality of Developer Studio so right there we can cover off essentially steps 1 and 2 without a lot of work.  Step 3 and 4 require a bit more work as we ideally aren’t just following a fixed list of workflow (as workflow can change from version to version) so we need to inspect the original AIF we used as our template and then based on if it is a WithMapping or WithOutMapping (or display-only) AIF, take it’s workflow and make overlays if they are not already, add your new form to them and then again based on the type of AIF it is, generate and add custom active links to some existing guides.

Finding out if your base AIF is a WithMapping or WithOutMapping template is as simple as check if one of the mapping fields exists, for me I used fieldID 300070001 for my check which is SR Type Field 1.  Knowing what kind of template you are basing yours on is important so that you know to make some WithMapping active links or WithoutMapping active links.  As stated in the previously linked documents, the custom workflow required to be built and then added to guides are either:

  • SRS:ADN:WithMapping_OnSubmit_109_SubmitRequest_CheckReqFields
  • SRS:ADN:WithMapping_OnSubmit_109_AddToCart_SetFlag

or

  • SRS:ADN:WithoutMapping_OnSubmit_109_SubmitRequest_CheckReqFields
  • SRS:ADN:WithoutMapping_OnSubmit_109_AddToCart_SetFlag

In either scenario, you then add your custom workflow into the appropriate guides at the appropriate location (under the equivalent OOTB active links).

That really is all it takes, with the above performed, you are ready to start tailoring your new AIF to your liking and then linking it to an SRD.  Let’s look at the utility I built to do all the above in a single swoop.  Here is an example of executing the utility from end to end:

AIFGenerator_Terminal

From the above we can see a few things, first off after providing the necessary arguments to start the utility (for usage examples / requirements you can pass -h), you are presented with a list of all the registered and active AIFs on the target Remedy system, this is accomplished by querying the SRS:CFGAdvancedInterface form.  After you have selected the template you want to use, you must give it a form name and a title.  The reason I also prompt for the title is so that we can auto create a new entry for our AIF in the SRS:CFGAdvancedInterface form when we are done.  We then ask for the Prefix for the new objects, this is to support those custom active links that must be added to the guides.  The end-to-end process above once you have answered all of the questions takes about 30 seconds if this is the first time you are adding an AIF since much workflow must be overlaid and then subsequent AIF creations take about 15-20 seconds (this is based upon time on my own system, maybe faster or slower on yours).

Let’s look at the results of the above run:

AIFGenerator_ResultDevStudio

AIFGenerator_WorkingList

As we can see, we have a perfect clone of the AIF we based ourselves on created for us as well as all the required workflow objects have been related and created where appropriate and linked to the new AIF as seen by the Working List above showing 201 items touching our new AIF form (can also see our 2 custom active links in that screenshot as well).

AIFGenerator_SRSCFGAdvancedInterface

Above we see that our AIF was also registered for us so we can begin using our new AIF right away.  You can download the utility below (unzip it to get the Jar file), it has only been tested on SRM 8.1 however I don’t see why this wouldn’t work on older versions as well.  The only real dependency on version is that this is built for 7.6.04+ as it leverages overlays but it hasn’t been tested outside of my sandbox.  Please let me know if you run into any bugs or if you think after using this utility it has been useful to you.

As always, happy coding 🙂

***Version 2.1

  • Changed the way I package the application.  Instead of packing everything into a single JAR, the zip file now contains a lib folder as well, make sure to always have the lib folder in the same folder as the AIFGenerator.jar file
  • Added capability for handling custom field submission for the AIFs, e.g. it will create a new version of the SRS:ADN:SHR_OnSubmit_120_SubmitCustomForm active link that will allow for adding your custom fields into as well as created a new version of the SRS:ADN:SHR_ServiceCall_SubmitCustomForm filter that actually does the Push into the AIF form.  This Service Call -> Push fields approach is new to 8.1 AIFs so this change will only happen if the SRM version is found to be 8.1 or higher.

***Version 2.0

Large update – Added the ability to specify how to handle custom workflow objects from the template AIF

***Version 1.1

Fixed several issues with custom object handling as well as improved some of the interactive options

***Version 1.0

Initial release of utility