Does anyone know how to get a process model's "Last Published By" user?

Certified Associate Developer

Does anyone know how to get a process model's "Last Published By" user? I can't find anything in the portal reports that exposes this information (though it's easily available via the modeler and the application manager)

OriginalPostID-223444

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Unfortunately, we have about ~4,000 process models in our environment, and so looping all of the process models and retrieving the details via getProcessModelDetailsByUUID() , then republishing the models did not seem like a feasibly solution.

    Just sharing here as well the path we chose: since Change username is already available since Appian 20.1, we just changed the username of the old administrator accounts to deployment.serviceaccount (just to follow our naming convention for service accounts) and added them to Service Accounts group to effectively convert them to deployment service accounts. Then we simply recreated our Basic user accounts.

    Thanks

  • 0
    Certified Lead Developer
    in reply to jraaquino

    To be fair, if you built a process that looped through all process models and republished them as a service account user, it would only take a few seconds per model and could run unattended like overnight, and you'd be done with it. 

    However I also agree with your tactic of changing the published-by users (especially in the case of former users, etc) to service account users.  A majority of my experience adminning a big production system is still from back in the days where we couldn't rename users and when there were no such thing as service accounts ;-)

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Tried using it process report where in we need to show last modified by after republishing the PM. But on the report it would not show up

    use below code in Column Definition of process report.

    split(split(
    getProcessModelDetailsByUUID(
    pm!id
    ),",")[6],":")[2]

  • 0
    Certified Lead Developer
    in reply to ganeshbabuj
    use below code in Column Definition of process report.

    I have no reason to think this would work.  getProcessModelDetailsByUUID is a plug-in function, and process reports are very touchy about which functions can run at all in column data (even some OOB functions don't work; in my experience the only ones you can assume will work are primitive functions, and maybe other simpler ones).

    What I was originally suggesting above is a *process* that takes the UUIDs output from a process report, then loops over them in-process to get the plug-in function results for each model, then deals with them all from there.  It's slow but it works.  These days, given the advent of a!forEach() etc, a lot of this could probably be done in an expression rule.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Thanks Mike, Had moved the code to Interface and now it works. Only issue is the screen loads very slowly with pagination of 100. Guess its expected as we are calling this plugin function on every row.

  • 0
    Certified Lead Developer
    in reply to ganeshbabuj

    Yes, per my past testing the plug-in takes a few seconds to run every single time.