REST API transfert access property without generation

Hello ARAS community Slight smile

We would like to change using REST the attribute Locked_by_id of an object. (typically give right to someone else to unlock/lock it.

Do you know if it is possible ?

we try this following the Doc but so far it doesn't work : 

PUT host/.../$ref Prefer: return=minimal { "@odata.id": "">host/.../User(‘C542FC153AE647A59CD6F6967295EF6B’)" }

The idea is to enable someone to work on an item unlocked by someone else who is absent and so don't stay bloqued.

Thank you :)

Parents
  • Hello,

    The locked_by_id is a system property that is typically set through use of the lock and unlock actions in an AML query.

    You can call these actions through REST by using a PATCH request and specifying the action you want to call inside of the body. As an example, the request below can be used to unlock a Part with a known ID.

    PATCH {base url}/Part('A6C9D695E75246758824B6B858622D73')
    {
        "@aras.action" : "unlock"
    }


    Chris

    Christopher Gillis

    Aras Labs Software Engineer

Reply
  • Hello,

    The locked_by_id is a system property that is typically set through use of the lock and unlock actions in an AML query.

    You can call these actions through REST by using a PATCH request and specifying the action you want to call inside of the body. As an example, the request below can be used to unlock a Part with a known ID.

    PATCH {base url}/Part('A6C9D695E75246758824B6B858622D73')
    {
        "@aras.action" : "unlock"
    }


    Chris

    Christopher Gillis

    Aras Labs Software Engineer

Children
  • Hello Christopher,

    thank you for your fast answer.

    i think i have not been clear enough.

    The process is as following,

    1/test user one works on the object id ('XXX'), he modificate and/or add elements on it.

    2/test user one goes to holidays

    at this point there is two steps possible, test user two will have to work on that object id ('XXX')

    2.1/ test user two dont want to continue the work initiated by test user one --> we just have to purge unlock the object.

    so test user two would be able to work on the object from scratch at the same level of revision.

    2.2/ test user two want to continue the work of test user one but we dont want to make evolve the generation level.

    here we have a problem because if we save the work of test user one and unlock the objet id ('XXX'), the revision will increase from 1 to 2 for example. And we dont want that for tracking documentation reasons.

    This why i wonder if it is possible to modify the attribute "locked_by_id" for an user to another without save and unlock the object ? 

    The real question is : is it possible to modifiy that attribute with REST or is it protected internaly ?

    Shall we write a method that follow an attribute on the object like "remove generation creation on saved" bool, that if it is thicked the save and unlock is done without new generation creation ? is it possible ?

    Thanks you so much.

  • We finally decide to switch the discipline to manual.

    easiest way to do this.

    Thank you.

  • Hello regardless my last comment, is it possible to bloc when we want the automatic revision for an item in discipline automatic ?

    Thanks.

  • Hello,

    It is not possible to block a revision for an Automatically revisioned item type.

    However, it would be possible to write your own versioning logic to accomplish what you're looking for. You could use two custom properties named something like my_major_rev and my_generation and use an onBeforeUpdate server event to increment these values as you need to.

    Chris