Clarity

  • 1.  How to lock an attribute on all tasks in projects?

    Posted Mar 23, 2017 07:36 PM

    I would like to know if there is a possibility to lock an attribute on the task object in all the tasks of all existing projects. I was able to do this in the studio side, but it locks only object instance and not all instances (all tasks on all projects).

    In this discussion: https://communities.ca.com/thread/10044444, there was a solution to create a GEL SCRIPT which allows to insert in the table ODF_LOCKED_ATTRIBUTES lines that I want to lock. So I thought to do this script just to test if it works:

     

    <gel:script xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:sql="jelly:sql">

    <gel:setDataSource dbId="Niku"/>
    <sql:update>
    insert into odf_locked_attributes
                        (ID,
                        OBJECT_CODE,
                        ODF_PK,
                        ATTRIBUTE_CODE,
                        CREATED_DATE,
                        CREATED_BY,
                        LAST_UPDATED_DATE,
                        LAST_UPDATED_BY)
                  values
                      (ODF_LOCKED_ATTRIBUTES_S1.nextval,
                        'task',
                        500789,
                        'xdf_att_fsp',
                        sysdate,
                        1,
                        sysdate,
                        1)
    </sql:update>
    </gel:script>

    But the problem is that the process does not execute, it's stucked in the 'start' step. did I done something wrong? i think if   this method works, I can make a loop on this sequence to insert all the lines of the attribute in order to lock them.

     Any help/thoughts??

    Regards

    Amine Tben



  • 2.  Re: How to lock an attribute on all tasks in projects?

    Broadcom Employee
    Posted Mar 23, 2017 10:57 PM

    Hi Amine,

    If its stuck in the start step and not even moving to the gel script step, I would be surprised if its a scripting problem. Can you please check and make sure the process engine heartbeat is happening. Also, can you create a very basic process to make sure the processes do start and complete fine?

     

    I have seen some sequence issues with the NEXTVAL() where process gets stuck but before we go there, please perform the above steps and confirm.   

     

    Thanks,

    Jerin 



  • 3.  Re: How to lock an attribute on all tasks in projects?

    Posted Mar 24, 2017 04:15 AM

    Hello Amine,

     

    The easiest way of locking attributes that I can suggest is to create a Process and assign it to the Task Object. Create a New System Action on the New Step and you can be able to lock all the attributes or selected attributes on the Task Object when this Step executes successfully.

     

    Suhail.