Clarity

  • 1.  Can a project lock be overriden via XOG

    Posted Sep 19, 2017 05:52 PM

    When performing a XOG update on a project, the XOG fails with the following message if the project is locked for edit by a user:

     

          <ErrorInformation>
            <Severity>FATAL</Severity>
            <Description>Project Object  failed</Description>
            <Exception><![CDATA[
    java.lang.Exception: XOG: Cannot lock project for update.
     at com.niku.xog.util.XOGContinueHandler.postProcess(XOGContinueHandler.java:36)
     at com.niku.xql2.handlers.BaseHandler.postProcess(BaseHandler.java:48)
     at com.niku.xql2.XQLVisitor.postProcess(XQLVisitor.java:1419)
     at com.niku.union.xml.dom.DOMWalker.postProcess(DOMWalker.java:210)
     at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:94)
     at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51)

    ... ]]></Exception>
          </ErrorInformation>

     

    Is there a way to override the lock or force my XOG update?

     

    Thanks!



  • 2.  Re: Can a project lock be overriden via XOG

    Posted Sep 19, 2017 08:22 PM

    We have portlets and data exceptions to warn when a project has been locked, see database table prlock.

     

    As an administrator, you can then either ask the user to manually unlock, or unlock the project yourself.

     

    Unaware of XOG being able to unlock a project.



  • 3.  Re: Can a project lock be overriden via XOG

    Posted Sep 19, 2017 08:37 PM

    Thanks Roland!  Our SME did make me aware of the security locks screen; however, I need to be able to do this via XOG as part of a process.



  • 4.  Re: Can a project lock be overriden via XOG

    Posted Sep 20, 2017 03:47 AM

    My understanding is that the lock is not in any of the sample xml files which suggests that it cannot be removed with XOG. Being a value in the database you should be able to remove it with unsupported direct db update in a gel script.



  • 5.  Re: Can a project lock be overriden via XOG

    Posted Sep 20, 2017 06:27 AM

    Thanks urmas!  We don't want to implement any unsupported methods, so if there's way to do this in an approved way within a process, then I guess we're out of automated options.



  • 6.  Re: Can a project lock be overriden via XOG

    Posted Sep 20, 2017 05:18 AM

    There's no way to override the "lock flag" through XOG. It is possible using direct updates, but that is not considered as best practice in CA PPM.

     

    The solution could be to indeed to create a portlet for users to show them the locked projects. If you are writing processes you can also include a check for locked projects and send notifications (e.g. to the project manager) that the process didn't apply changes to these projects because it is locked.

     

    Hope that helps,

     

    Anthony



  • 7.  Re: Can a project lock be overriden via XOG

    Posted Sep 20, 2017 06:36 AM

    Thanks Anthony!  It looks like that's the way we may have to go.



  • 8.  Re: Can a project lock be overriden via XOG

    Posted Sep 20, 2017 07:29 AM

    Hi Tanessa. Another architecture option is a 'Check for Lock' loop. Better than erroring out.

    For this process, my customers have said 'X days' is long enough to wait, if after X days we consider it a 'lost lock' and go ahead with clear the lock flag in the db (unsupported, on premise) and write the data. I can share more if interested. There are good Ideas here in the community around this stuff as well.



  • 9.  Re: Can a project lock be overriden via XOG

    Posted Sep 27, 2018 05:36 PM

    Hello Robert,

     

    I'm very interested by your process to check if the Project is Locked or not. How did you manage to use the property "Locked" in a condition between steps (it is not available on the object Investment or Project) ?

     

    I need to update several tasks at the same time with XOG and sometimes I get the error "Cannot lock project for update." : one XOG is in conflict with another one.

     

    Personally, I have tried this (see below).

     

    Create a custom attribute (boolean type) on Project.

    Update it with sql : select count(*) from prlock where prtablename = 'SRM_PROJECTS' and prrecordid = @v_project_id

    Create a Process with 2 steps "Check Lock" and "Update Task".

    2 Conditions : if "Is Lock" = 0 then Update Task; otherwise ("Is Lock" = 1) then re-run step.

    In this example, if the Project is locked for one minute, the bg tries to evaluate the condition recursively : maybe 100 times in less than 10 seconds (the performance here depends on the architecture in place I guess). And eventually fails and puts the Processus on Hold if it loops too many times (thanks bg ).

     

    Then, I tried to put a tempo with another step "Wait Lock" by using the Condition Step."Check Lock" Number of times repeated <= 100 or > 100. But the bg doesn't do anything on Wait Lock, it just waits at the first execution... I would have thought it would go back to step "Check Lock" until the 100th time.

     

     

     

    @Robert, what did you use in your step "Count" ?

     

    Is there anyway to put a tempo (2 seconds for instance) in a process ? The condition 'X days' is way too long for my need.

     

    Many Thanks,

     

    Regards,

    David



  • 10.  Re: Can a project lock be overriden via XOG
    Best Answer

    Posted Sep 21, 2017 08:03 AM

    I reviewed these suggestions with my team, and we decided to:

     

    * Add a check within the process that will send a notification on any locked projects that caused exclusions during processing

    * Create report on projects that have been locked for X number of days so our functional team can help the project managers understand the importance of submitting their changes in a timely fashion

     

    Thanks to all!