get an object in groovy postcreate script

This topic has 4 replies, 3 voices, and was last updated 5 years, 11 months ago by marco3575.

  • Author
  • #13788

    i have a recon which create objects /managed/person

    In the managed.json, i have :

    “name” : “person”,
    “comment” : “entite regroupant les personnes”,
    “postCreate” : {
    “type” : “groovy”,
    “file” : “groovyscript/person/postCreatePerson”

    I have 100 persons in my source and i see them in my log.
    And i can see that for each person i pass in the postCreatePerson.groovy script.

    My question is : how can i get the current object person in my postCreatePerson.groovy ?

    thanks and sorry for my english


    You can do var curPerson =‘managed/person/’ + source._id);

    You would then be able to manipulate the properties or attributes within that curPerson object. Is that what you are looking for?


    i’ve tried this but i have an error “no such object source” or something like that.
    in a “onCreate” script. I have a source object and a target object.
    but in a postCreate i have it seems that i have no source object. so i don’t know how to get my current object :(

     Jake Feasel


    In “onCreate” for managed objects, the binding you need is “newObject”.


    my person object is in “object”
    i can directly get object._id,

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?