How to find the actual number of versions a process model has?

I am trying to use the Appian Smart Service 'Delete Process Model Versions' to remove unwanted old versions of process models. The smart service is working fine, but my question is, "How can I find out how many versions each process model has, so that I know which ones are candidates for version deletion?".

Using a Process Model Version report, I can find out the latest version number, but as the version number does not change when earlier versions are deleted, that is no use to me.

Can anybody tell me how I can find out the actual number of versions a process model has?

OriginalPostID-228639

OriginalPostID-228639

  Discussion posts and replies are publicly visible

  • Hi Paul, Would it be possible to read "Process Model Versions" report through a!queryProcessAnalyics() and apply the filter on the name / UUID (need to be added), and then look at the total count should give you the details which are looking for.
  • I don't think the above-mentioned approach works because, as soon as the version is deleted(from the interface or by making use of smart service), the corresponding row from Portal Report disappears and if all the versions are deleted, the pm!version starts at 1.0 again. So it may not be worth at all depending on the Report.

    @paule As the description of the plugin is stating that 'This smart service allows you to delete process model versions from both, the interface and disk.', it may not be possible to get the actual number of versions as the data is also erased from file system when we delete the version using the 'Delete Process Model Versions' smart service.
  • The latest version of the Shared Component "Content Details by UUID" now returns the number of versions a process model has:

    Example:

    =getProcessModelDetailsByUUID("0003dd0c-9352-8000-f92f-7f0000014e7a")

    returns

    Type: Process Model, Name: [en_GB=, en_US=Simple Model Does Nothing, it=, fr_FR=], Id:235, UUID:0003dd0c-9352-8000-f92f-7f0000014e7a, Creator: eduardo.fuentes, Last Modified by: eduardo.fuentes, Parent: Eduardo, Parent Id: 6, Location: [Process Models -> Eduardo ], IsPublic: false, Created on: 6/2/16 5:06:26 AM GMT, Last Modified on: 7/14/16 8:15:42 AM GMT, Number of Versions: 5


    which means I can extract the versions using

    =keyval(getProcessModelDetailsByUUID("0003dd0c-9352-8000-f92f-7f0000014e7a"),{"Number of Versions"},":",",")
  • I have just come back to this problem, having been diverted for a couple of months.

    I am now able to use Content Details By UUID to show the number of versions existing for each process model. I am passing a list of Process Model Ids and the number of versions to keep into the 'Delete Process Model Versions' Smart Service.

    For example, I pass in Process Models Id of 201 and Keep Vwersions of 5.

    I'm getting the following message in the jboss1-stdOut.log:

    12:38:01,296 INFO [stdout] (ajp-/0.0.0.0:8009-12) 2016-10-17 12:38:01,296 [ajp-/0.0.0.0:8009-12] ERROR com.appiancorp.processmodelutilities.ProcessModelVersionDeleter - InvalidVersionException: 0.0 of process model id: 201 is only in the file system and has been deleted

    Any idea what I'm doing wrong?
  • How many versions does it have? This error shouldn't prevent the smart service from continuing, does it?
  • @paule @Eduardo Fuentes - I just saw this thread and am trying to do the same thing. How did you get the list of UUIDs for all the process models in your system?
  • 0
    Certified Lead Developer
    in reply to garym
    I do this in my system and the short answer is, i run query a process analytics call on a process model report of all process models in the system.
  • 0
    Certified Lead Developer
    in reply to Eduardo Fuentes
    @Eduardo: out of curiosity - does the plugin return number of CURRENT versions, or just highest version number, or both? I now have a bunch of process models in the system where i've trimmed out (hundreds) of past versions, so it might become useful for me to see the number of current versions as opposed to just the current version number which is what's shown in a PM Report.
  • - You may have already figured this out by now, but I am doing the same thing you mentioned above and I was able to confirm that the plugin will return the current count of versions. I am deleting all but the most recent version with the 'Delete Process Model Versions' smart service (Keep Versions input = 1) and the getProcessModelDetailsByUUID is returning 2 for the version count of all process models. It seems this count is referencing the Draft and the published version.