10 Replies Latest reply on Dec 10, 2015 1:08 AM by AlasdairC

    New Module - Process Ref

    Dan Rookie

      I have built a new module to manage a particular work load internally and it all seems to all work (objects, windows, processes, queries etc) but I cannot figure out how to get the 'Process Ref' in 'Process Management' to populate, I'm not sure where the BOO for doing this resides, if it is even done using BOO.  I found the document below but It doesn't appear to give me the detail on how to populate it with a new prefix etc.  I'm using Service Desk 7.8.3 if it makes a difference to how this functionality works?  Any help or guidance would be much appreciated.

       

      How to write a calculation to pick up value from Child Object. / How to populate Process Ref

        • 1. Re: New Module - Process Ref
          Apprentice

          I think you may have to use a SQL trigger to concatenate the CreateIdentity of the Id attribute to your required prefix.

           

          This is something I'll be trying on our DEV system at the weekend.

           

          Alasdair.

          • 2. Re: New Module - Process Ref
            Afzal.patel Apprentice

            We have built two processes within the Call Management Module, Release and Triage.  I used this trigger to grant a separate prefix; seems to work ok.

             

            USE [DEVSERVICEDESK]

            GO

            /****** Object:  Trigger [dbo].[I_POPULATE_CALL_REF]    Script Date: 10/22/2015 10:56:40 ******/

            SET ANSI_NULLS ON

            GO

            SET QUOTED_IDENTIFIER ON

            GO

             

            ALTER TRIGGER [dbo].[I_POPULATE_CALL_REF] ON [dbo].[ca_call]

            FOR INSERT

            AS

             

            declare @call_id   int,

              @call_guid uniqueidentifier

             

             

            declare @prefix_char  varchar(6),

              @call_reference varchar(30)

             

             

            select @call_id = ca_id,

              @call_guid = pm_guid

            from inserted

             

            begin

             

            if (select usr_releasetypecall1 from inserted) IS null

            set @prefix_char = 'TRI/'

             

             

            if (select usr_releasetypecall1 from inserted) IS NOT null

            set @prefix_char = 'REL/'

             

             

             

             

            set @call_reference = @prefix_char + convert(varchar,@call_id)

             

             

            update pm_process

            set usr_processref = @call_reference

            where   pm_guid = @call_guid

             

             

            end

            • 3. Re: New Module - Process Ref
              Dan Rookie

              Ok, that's great, I've found the triggers and created one against the table for the main business object in my new module and it creates the process ref for the main business object in the process management module, but there appears to be a missing attribute on the task business object that was created namely some sort of serial number (this appears in all collections by the looks of it) that sequential increments for each task added against each record in the main business object.  I'm not sure what function within LANDesk or SQL is populating this serial number and the attribute wasn't created automatically in the tasks business object when creating the new module as it was in all the other collections that were created.  Could be a bug I guess?

              • 4. Re: New Module - Process Ref
                Apprentice

                Take a look at How do I create a counter or id on my collection object?

                 

                I think this will steer you in the direction you're after.

                • 5. Re: New Module - Process Ref
                  Dan Rookie

                  Thanks for that, it works and creates a serial number field that I can use in the process ref, but I think there might be something else wrong as the 'default' serial number which if i'm not mistaken is coming from the 'Process Management\Process\id' is filled with 0's, this is what is appearing in the history of events against each ticket, not sure if I can change what is displayed in the history query, but I'd say that some sort of serial number attribute should have been created when the object was created by the create new module wizard.

                  • 6. Re: New Module - Process Ref
                    Apprentice

                    Hi Dan,

                     

                    I got our SQL trigger working on the Top Level BO, but I think I've hit something similar on the Tasks object within the newly created module. (I've logged it with support)

                     

                    Did you get anywhere with this at all?

                     

                    Alasdair.

                    • 7. Re: New Module - Process Ref
                      Dan Rookie

                      Yes, I managed to get it all working.  I had to add my own serial number attribute to the 'Tasks' business object that was created and wrote a 'before save' BOO calculation to populate it, this is then used in the trigger to populate the process ref.  The issue I now have is that unlike all the other Task BO's in other modules (out of the box modules), these appear to have a serial number field already that does not require some BOO to populate it, this attribute is also the default serial number in the history pane.  So in my new module all the Tasks that are added have a serial number of Zero as you cannot make it the 'Is Name?' attribute for the BO.

                       

                      import System

                      static def GetAttributeValue(NewModuleTask):

                        Value = NewModuleTask._NewModule._Tasks.Count

                        return Value

                      • 8. Re: New Module - Process Ref
                        Apprentice

                        "So in my new module all the Tasks that are added have a serial number of Zero as you cannot make it the 'Is Name?' attribute for the BO."

                         

                        I raised that with support. They came up with a SQL script to run to switch the IsName on for the serial number attribute. It's GUID specific though. I'm hoping to discuss running that with our DBA today sometime.

                         

                        Alasdair

                        • 9. Re: New Module - Process Ref
                          Dan Rookie

                          That sounds interesting, let me know how you get on with it, I'd like to give that a try.

                           

                          Thanks

                          Dan

                          • 10. Re: New Module - Process Ref
                            Apprentice

                            Dan

                            The script did the job and I'm now getting the correct headers on the Tasks and in the WebDesk History pane.

                             

                            As it's GUID dependent you're probably best off contacting support and getting them to advise rather than me posting it here.

                             

                            Alasdair