Clarity Service Management

Expand all | Collapse all

Trigger Event Unique CI Name

  • 1.  Trigger Event Unique CI Name

    Posted 09-15-2015 10:53 AM

    I'm running SDM 12.6, and I'd like to know if there is a way to create a trigger event that would check the name of a CI on create and validate it as unique.  If the name not unique stop the user from creating the CI.  If unique name, allow insert into database.

     

    Is this possible?  Can anyone help me with a spl solution that would solve this problem?

     

    Thanks!

     

    John



  • 2.  Re: Trigger Event Unique CI Name

    Posted 09-16-2015 09:08 AM

    Hi John,

    I dont believe this can be done out of the box using an event/trigger, as the spel code behind it to do that functionality doesnt exist out of the box.  For something like this, you may be able to do it using a data partition constraint on CIs as a "create" - such that the name cannot already exist. I am not sure of the exact syntax off hand to be used, but if you look at existing constraints you may be able to piece it together that way and test it out.

    The only other way to accomplish this would be using custom spelcode, which can certainly be done, but is outside the scope of support.  You may get some info here on the communities from folks who have done something similar if they are willing to share it.

     

    Hope this helps,

    Thanks,

    Jon I.



  • 3.  Re: Trigger Event Unique CI Name

     
    Posted 09-16-2015 09:33 PM

    There is code in 'force_unique_userid.maj' & 'force_unique_userid.spl' that checks whether a new user ID is unique.  These are inserted into site/mods/majic if you select the Options Manager setting to force userid's to be unique.  From a quick look I would think it could serve as a model for what you're trying to achieve. Worth a try, anyway.

     

    Regards,

    james



  • 4.  Re: Trigger Event Unique CI Name

    Posted 09-17-2015 03:15 PM

    Hi, place files to site/mods/majic and recycle SDM services. First test it on your dev or test system. If something goes wrong delete files and recycle SDM services.

    Attachment(s)

    zip
    unique.spl.zip   369B 1 version
    zip
    unique.mod.zip   258B 1 version


  • 5.  Re: Trigger Event Unique CI Name

    Posted 09-17-2015 03:21 PM

    Thanks Gutis,

     

    That's exactly what I'm trying.  I'm trying to use James' suggestion to re-use force_unique_userid.spl code and reuse it.  So far, I have the code "changed", but SDM will not restart, so it does not like the code.  I'm going to keep trying though.  I made some assumptions in converting that code.  So I'll walk through them and see if I made an error somewhere.  Thanks for the support.

     

    John



  • 6.  Re: Trigger Event Unique CI Name

    Posted 09-17-2015 03:37 PM

    If you have some troubles starting CA SDM when you do some spl modifications, you should look to the log. The log will contain the error there you will find script line number that causes problem. It is easier to debug script when SDm is started, so first of all i suggest to write the trigger and simple spel script e.g.

    nr::unique(...)

    {

    return;

    }

     

    Then you can modify your spl and kill the spel_srv process and look in the log for the errors if spel server started successfuly you will se that, otherwise you see the error. If you where unlucky and spel_srv process hit limit of the automatic restart , use pdm_d_refresh command.