Hi All, Is there is any way to retrieve process model id from its U

Hi All,
Is there is any way to retrieve process model id from its UUID, as process model id will be changing from one environment to another environment.
Thanks in advance.
Regards
Pavan Gantasala
...

OriginalPostID-130332

OriginalPostID-130332

  Discussion posts and replies are publicly visible

  • Hi Pavan Gantasala,
    You can use fn!getprocessmodeldetailsbyuuid("UUIDValue") function to get Process model Id.
  • 0
    Certified Associate Developer
    You can use below expression.
    =split(split(getprocessmodeldetailsbyUUID("<UUID>"),",")[3],":")[2]
  • 0
    A Score Level 1
    in reply to Naresh

    you need to consider the string may contain multiple commas in the "Name" value, so the "split" will be affected by this


    "Type: Process Model, Name: [en_GB=, en_US=PM Test, es=], Id:5946, ...."

  • 0
    Certified Lead Developer
    in reply to fernandorgh

    agreed, for this I would just go ahead and use the extract() function.

    index(extract( local!details, "Id:", ", UUID" ), 1, null())

  • 0
    Certified Lead Developer
    in reply to fernandorgh

    On that note, here is the expression rule I've developed that will take the output of this expression and split it up into a usable dictionary (i'm unclear why the plugin itself didn't just go ahead and do that, but I digress) --

    a!localVariables(
      local!rawText: if(
        rule!GCO_RULE_General_isBlank(ri!uuid),
        " ",
        getprocessmodeldetailsbyuuid(ri!uuid)
      ),
    
      local!type: index(extract(local!rawText, "Type: ", "," ), 1, null()),
      local!nameList: trim( split( extract( local!rawText, "Name: [", "]" ), "," )),
      local!nameArray: a!forEach(
        local!nameList,
        a!localVariables(
          local!pieces: split(fv!item, "="),
          a!map(
            locale: local!pieces[1],
            name: local!pieces[2]
          )
        )
      ),
      local!id: index(extract( local!rawText, "Id:", ", UUID" ), 1, null()),
      local!uuid: index(extract( local!rawText, "UUID:", ", Creator" ), 1, null()),
      local!creator: index(extract( local!rawText, "Creator: ", ", Last" ), 1, null()),
      local!lastModifiedBy: index(extract( local!rawText, "Last Modified by: ", ", Parent"), 1, null()),
      local!parent: index(extract( local!rawText, "Parent: ", ", Parent Id:" ), 1, null()),
      local!parentId: tointeger( index(extract( local!rawText, "Parent Id: ", "," ), 1, null())),
      local!location: index(extract( local!rawText, "Location: ", ", Is" ), 1, null()),
      local!isPublic: index(extract( local!rawText, "IsPublic: ", ", Created" ) = "true", 1, null()),
      local!createdOn: index(extract( local!rawText, "Created on: ", ", Last" ), 1, null()),
      local!lastModifiedOn: index(extract( local!rawText, "Last Modified on: ", ", Number of" ), 1, null()),
      local!numVersions: index(extract(local!rawText & "-END-", "Number of Versions: ", "-END-" ), 1, null()),
    
      a!map(
        type: local!type,
        primaryName: property(index(local!nameArray, 1, null()), "name", null()),
        nameArray: local!nameArray,
        id: local!id,
        uuid: local!uuid,
        creator: local!creator,
        lastModifiedBy: local!lastModifiedBy,
        parent: local!parent,
        parentId: local!parentId,
        location: local!location,
        isPublic: local!isPublic,
        createdOn: todatetime(local!createdOn),
        lastModifiedOn: todatetime(local!lastModifiedOn),
        numVersions: local!numVersions,
        
        /*rawText: local!rawText*/
      )
    )
    
    /* developed by: Mike Schmitt */