2 Replies Latest reply on Oct 17, 2016 8:35 AM by Michael Ackers

    BSA console 8.7 Compliance Rule Definition Editing

    Michael Ackers

      Hi,

      Is there a way to copy and paste into the Rule Definition. I am aware of the copy/paste using the buttons for the conditions in the editor which seems to use an internal clip board.

      However, it is very time consuming to use the point and click buttons to add basic rules, copy/cut/paste for anything more than simple rules.

      If you have several nested if/then/end levels it can be difficult to add the levels with the buttons and easily to lose the level of indenting.

       

      I would like to simply edit in an external editor notepad++, vim et.al and then paste from the windows clipboard into the rules into a new blank rules rule definition.

      Is there a 'free text' mode to allow this?

      Thanks

        • 1. Re: BSA console 8.7 Compliance Rule Definition Editing
          Bill Robinson

          on the 'compliance' tab in the template you can copy/paste entire rules out/in other templates, or w/in the same template.  otherwise i don't think you can paste in arbitrary text into the rule editor.

          • 2. Re: BSA console 8.7 Compliance Rule Definition Editing
            Michael Ackers

            Hi Bill, thanks for the quick response,

             

            I have managed to copy rule conditions between/within templates as you say which has worked to an extent.

            As a bit of background:

            I was trying to create several simple rules for clarity, however I cannot seem to pass local properties between rules and there does not seem to be any way to have any governing rule dependency (logic) so you could say:  if Rule A succeeds Run Rule B else Run Rule C

            So, I decided to try all the individual rules in one larger one. However this is quite difficult to insert with point and click buttons and thought it would be easier to edit in an external editor, keeping within the syntax of the compliance rules and then pasting into the rule definition. I guess I'm out of luck.

             

            This is the kind of rule I was trying (below), and it's difficult doing it the point and click way as it's easy to miss an else and difficult to insert some conditions if missed so it gets messy. Maybe I'm not using the correct method to do this which would be better using Batch Jobs but there is a lack of dependency logic with that.

             

            ??VAR_GETDATA_FROM_EO?? := "Extended Object Entry:Get Some Info//Data"."Value1 as String (All OS)"  AND

            if

               ??VAR_GETDATA_FROM_EO?? contains "somevalidationtext"

            then

                if

                   "Directory:/somepath/path2scripts/scripts" exists

                then

                   if

                      "Command:/usr/local/script/mountAnNFSfilesytem.ksh >/dev/null 2>&1".Exitcode = 0

                   then

                      if

                         "Command:mount 2>/dev/null |grep 'nfs'|grep -q '/somepath/aMountedNFSfilesystem'".Exitcode = 0

                      then

                         if

                            "File:/somepath/aMountedNFSfilesystem/SCRIPTS/somescript.ksh" exists

                         then

                               if

                                   "Command:su - useraccount -c '/somepath/aMountedNFSfilesystem/SCRIPTS/somescript.ksh :/somepath/path2scripts/scripts'".Exitcode = 0

                               then

                                   "Command:su - useraccount -c '/somepath/path2scripts/scripts/somescript.ksh'".Exitcode = 0

                               end

                         else

                            "Command:echo 'ERROR: somescript.ksh Does not Exist'".Out_Put = "ERROR"

                         end

                      else

                         "Command:echo 'ERROR: /somepath/aMountedNFSfilesystem is not mounted'".Out_Put = "ERROR"

                      end

                    else

                      "Command:echo 'ERROR: running /usr/local/script/mountAnNFSfilesytem.ksh failed'".Out_Put = "ERROR"

                   end

                else

                    "Command:echo 'ERROR: somepath/path2scripts/scripts does not exist'".Out_Put = "ERROR"

                end

            else

               "Command:echo 'ERROR: ??VAR_GETDATA_FROM_EO?? is NOT Set'".Out_Put contains "ERROR"

            end