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

14 thoughts on “AIFs – Simplifying their creation via automation

  1. FYI – I have re-uploaded a new version of the Jar file at 3:45pm EST on Feb 10th that addressed a few issues I found through further testing. If you downloaded day one, please re-download before testing.

    Issues corrected:

    – Better input validation (e.g. retry capabilities when not entering valid options)

    – Better handling of scenarios where you are making a copy of a copy where the new custom active links from the first copy were being attached to our new copy which resulted in duplicate actions

    – Better handling of custom objects attached to the source AIF you are making a copy from, will not try to overlay custom objects, simply add our new AIF to it

  2. Hi,

    Thanks , It seems helpful. I am getting the following error when trying to create new AIF form and relate it to ootb workflows on 8.1 environment:

    ” AIFGenerator v2.1 – Created by Curtis Gallant (cgallant@soleauthority.net)

    Please input the number for the corresponding AIF you wish to copy

    1. SRS:AdvancedInterface_PasswordReset
    2. SRS:AdvancedInterface_WithoutBackendMapping
    3. SRS:AdvancedInterface_WithBackendMapping
    4. IAM:SRM:PasswordChangeRequest_AIF
    5. IAM:SRM:Access_RequestAccessRights_AIF
    6. IAM:SRM:Access_RevokeAccessRights_AIF
    7. IAM:SRM:EUA:EnableAccountRequest_AIF
    8. IAM:SRM:ApplicationURL_AIF
    9. IAM:SRM:EUA:UnlockAccountRequest_AIF
    10. SRS:AdvanceInterfaceProductOrdering

    Enter selection: 3

    Cloning AIF: SRS:AdvancedInterface_WithBackendMapping

    Enter the new AIF Form name: SRM:AIF:Test

    Enter the new AIF Template name: AIF Test

    Enter the prefix for custom objects: SRM:Test

    Please input the number for the corresponding custom workflow handling option

    1. Create new versions of custom workflow
    2. Add new AIF form as a related form to existing custom workflow
    3. Ignore custom workflow

    Enter selection: 1
    ERROR (303): Form does not exist on server; SRM:AIF:Test
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.verifyStatus(Unknown Sour
    ce)
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.a(Unknown Source)
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.arCall(Unknown Source)
    at com.bmc.arsys.api.ProxyJRpc.ARGetListViewObjects(Unknown Source)
    at com.bmc.arsys.api.ARServerUser.getListViewObjects(Unknown Source)
    at com.bmc.arsys.api.ARServerUser.getListViewObjects(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.b(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.a(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.main(Unknown Source)
    ERROR (488): Field creation error occurred at the indicated list position.; 0
    ERROR (388): VUI does not exist for the specified form; SRM:AIF:Test :
    ERROR (303): Form does not exist on server; SRM:AIF:Test
    Exception in thread “main” java.lang.IndexOutOfBoundsException: Index: 3, Size:
    0
    at java.util.ArrayList.rangeCheckForAdd(Unknown Source)
    at java.util.ArrayList.add(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.d(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.b(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.main(Unknown Source)

    C:\Users\Administrator\Desktop\AIFGenerator>”

    After That i can see that a regular form is created and added to some of the OOTB workflows. should i create the form before running the command and please can you explain the 3 options
    Thanks

    1. Since everything is done in one swoop, it’s possible there was an error. There is no need to create the form prior as it created in the first actual step. Do you have development cache turned on? Wondering if it’s just a case of the form did not get created in a timely enough fashion.

  3. Hi Curtis,

    Thank you very much for publishing this application. It worked like a charm! saved me so much time and effort.

    Thank you 🙂

  4. Hi Curtis,
    First of all thanks for sharing this. This is a brilliant concept.

    I was trying it with 8.1.0.1 and I did hit some issues. I had similar error as Alaa (see end of the post).
    This is what I found out in detail:
    • The form copy fail and the view is almost empty (only a few field that looks like the default view of a new form). Did a manual copy of the form with same name afterwards.
    • All Filters/Active Links Guides overlays got “emptied”. I had to one by one and change it to”
    – Associated Form: Additive
    – Permissions: no overlay (active Link Guide)
    – Other Definitions: no overlay.

    BTW as well. When I did try to re-run the command over the same form again. I add some expected errors. Still it could be good to improve the logging as well by outputting which object failed so that you can manually check it afterwards. Will make it easier to debug.

    Have you thought to release the project source so that we can contribute to it?

    Regards
    VeV

    =============================================================

    Enter selection: 1
    Target form already exists, skipping
    ERROR (8924): Two or more forms in the workflow form list have duplicate form names.; SRS:AI_OICRequest
    ERROR (8924): Two or more forms in the workflow form list have duplicate form names.; SRS:AI_OICRequest
    ERROR (382): The value(s) for this entry violate a unique index that has been defined for this form;
    ERROR (382): The value(s) for this entry violate a unique index that has been defined for this form;
    ERROR (345): Duplicate active link name; AIF:OIC:SRS:ADN:WithMapping_OnSubmit_109_SubmitRequest_CheckReqFields

    SRS:AI_OICRequest created and deployed successfully

    =============================================================
    Enter selection: 3

    Cloning AIF: SRS:AdvancedInterface_WithBackendMapping

    Enter the new AIF Form name: SRS:AI_OICRequest

    Enter the new AIF Template name: OIC Delegation Request

    Enter the prefix for custom objects: AIF:OIC:

    Please input the number for the corresponding custom workflow handling option

    1. Create new versions of custom workflow
    2. Add new AIF form as a related form to existing custom workflow
    3. Ignore custom workflow

    Enter selection: 1
    ERROR (303): Form does not exist on server; SRS:AI_OICRequest
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.verifyStatus(Unknown Source)
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.a(Unknown Source)
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.arCall(Unknown Source)
    at com.bmc.arsys.api.ProxyJRpc.ARGetListViewObjects(Unknown Source)
    at com.bmc.arsys.api.ARServerUser.getListViewObjects(Unknown Source)
    at com.bmc.arsys.api.ARServerUser.getListViewObjects(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.b(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.a(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.main(Unknown Source)
    ERROR (488): Field creation error occurred at the indicated list position.; 0
    ERROR (388): VUI does not exist for the specified form; SRS:AI_OICRequest :
    ERROR (303): Form does not exist on server; SRS:AI_OICRequest

    SRS:AI_OICRequest created and deployed successfully

    =============================================================

    1. Hi Vev,

      I’ve been meaning to release a newer version of this utility with more feedback and now that I finished up a large PS project that has taken the bulk of my time for the past ~12 months I should have some time in the coming weeks to make an improved version of this utility. I’ve gotten some very positive feedback from users where it works exactly as it should and a few where it is similar to your experience. Sometimes it’s simply the target system not being fast enough but other times I haven’t gotten enough feedback to track down the issue (not really the users fault as there isn’t much feedback this published build gives).

      So I would say stay tuned and once I have a new build ready I will publicize it. As far as releasing the sources, at this point I would say no, while the instructions on what it actually does is well understood and published in several areas in the BMC Communities and in the BMC SRM documentation, there was quite a bit of complexity to automate it properly that I spent many hours fighting with so it’s not so much that I think people couldn’t participate, it’s more at this point to protect my investment in time in putting it together. I hope you can appreciate this fact.

      Thank you for the feedback though.

  5. Hi Curtis,
    I like your idea to make easier the process of creating an advanced interface, unfortunately like Alaa and Vev I have the following error:

    Enter selection: 3

    Cloning AIF: SRS:AdvancedInterface_WithBackendMapping

    Enter the new AIF Form name: QTZ:Test

    Enter the new AIF Template name: Prueba

    Enter the prefix for custom objects: QTZ:TEST:

    Please input the number for the corresponding custom workflow handling option

    1. Create new versions of custom workflow
    2. Add new AIF form as a related form to existing custom workflow
    3. Ignore custom workflow

    Enter selection: 3
    ERROR (303): Form does not exist on server; QTZ:Test
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.verifyStatus(Unknown Sour
    ce)
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.a(Unknown Source)
    at com.bmc.arsys.apitransport.ApiProxyJRpcBase.arCall(Unknown Source)
    at com.bmc.arsys.api.ProxyJRpc.ARGetListViewObjects(Unknown Source)
    at com.bmc.arsys.api.ARServerUser.getListViewObjects(Unknown Source)
    at com.bmc.arsys.api.ARServerUser.getListViewObjects(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.b(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.a(Unknown Source)
    at net.soleauthority.arsys.utils.AIFGenerator.main(Unknown Source)
    ERROR (488): Field creation error occurred at the indicated list position.; 0
    ERROR (388): VUI does not exist for the specified form; QTZ:Test :
    ERROR (303): Form does not exist on server; QTZ:Test

    QTZ:Test created and deployed successfully

    I’m currently testing in an environment 8.1.02

    Thanks and regards.

    1. Just to be sure, you are logging in with an account that has Administrator permission? This utility is in need of some love in general so I may look at improving it when I have some cycles.

Leave a Reply

Your email address will not be published. Required fields are marked *