3 Replies Latest reply on Dec 13, 2018 6:30 AM by Uwe Ryczek

    How to create overlay of any OOB workflow using Java API.

      We have a requirement in which requires to create overlay of workflows using Java API. I tried to create overlay using createOverlay() method from ARServerUser class, Ibut no success. kindly help me, how can we create overlay of OOB workflows using Java api.

       

      Thanks in advance

        • 1. Re: How to create overlay of any OOB workflow using Java API.
          Ganesh Gore

          You can use co command in AR System driver program or in Java_Driver :

          AR Driver.JPG.jpg

          • 2. Re: How to create overlay of any OOB workflow using Java API.
            Curtis Gallant

            Creating overlays via Java API is quite simple, you just need to know what type of object you are overlaying and it's name so that you can create an OverlaidInfo object to pass to the createOverlay method.

             

            E.g. if you want to overlay an active link called: HPD:HII:CreateIncident_100`! you would do something like this as a sample:

             

            OverlaidInfo overlaidInfo = new OverlaidInfo();

            overlaidInfo.setName("HPD:HII:CreateIncident_100`!");

            overlaidInfo.setObjectType(Constants.AR_STRUCT_ITEM_ACTIVE_LINK);

            try {

               ctx.createOverlay(overlaidInfo);

            } catch (ARException e) {

               System.out.println(e.getMessage());

            }

             

            What I usually do is just create a little helper method that I can pass in the objectStruct type and the name, e.g.:

             

            private static void createOverlayForObject(int objectStructType, String objectName) {

                OverlaidInfo overlaidInfo = new OverlaidInfo();

                overlaidInfo.setName(objectName);

                overlaidInfo.setObjectType(objectStructType);

                try {

                   ctx.createOverlay(overlaidInfo);

                } catch (ARException e) {

                   System.out.println(e.getMessage());

                }

            }

             

            You can find all the objectStructTypes in the Constants class but typical ones are AR_STRUCT_ITEM_ACTIVE_LINK, AR_STRUCT_ITEM_FILTER, AR_STRUCT_ITEM_CONTAINER, etc.

             

            Hope this helps.

            2 of 2 people found this helpful
            • 3. Re: How to create overlay of any OOB workflow using Java API.
              Uwe Ryczek

              In newer ARS/API versions (>=9.1) BMC added Overlay-Groups to overlaid/custom objects...so you have to add this information to your overlay.

               

              the easeast way is: switch the ARServerUser context to "Best Practice Customization" mode and set the Overlay-Group.

               

              private static void createOverlayForObject(int objectStructType, String objectName) {

                  OverlaidInfo overlaidInfo = new OverlaidInfo();

                  overlaidInfo.setName(objectName);

                  overlaidInfo.setObjectType(objectStructType);

                  try {

                        ctx.setBaseOverlayFlag(false);

                        ctx.setOverlayFlag(true);

                        ctx.setOverlayGroup("1");

                        ctx.setDesignOverlayGroup("1");

                        ctx.createOverlay(overlaidInfo);

                  } catch (ARException e) {

                     System.out.println(e.getMessage());

                  }

              }

               

               

              If you set those ARServerUser context attributes and create a new object, the result is an "Custom Object"

              2 of 2 people found this helpful