Can I create a Picker of Process Models?

Certified Senior Developer

Is it possible to add a Picker to a form that selects from Process Models? (Like you see in the interface designer).

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    Not sure the use case but Appian's Decisions feature may help, as PM can be an output. So, you could pick something else that results in PM selection.

    Appian object output types - Decisions can return Appian objects as outputs which enables uses cases such as determining task assignment and dynamic process execution.

    docs.appian.com/.../Appian_Decisions.html
  • 0
    Certified Senior Developer
    Thanks Christine. The Decisions feature is very similar to what I want to do (start processes dynamically), however the issue I am running into is that I am creating a common application (for LDAP Sync) that will be deployed to multiple environments that will host different Appian applications. Each application may optionally have processes that need to run immediately after the LDAP sync completes, for instance to synchronize the user data into their respective databases. Currently I am at using environmental constants with the process IDs in them, or the solution in this thread: community.appian.com/.../is-there-a-way-to-get-the-process-model-id-from-its-uuid

    However, an elegant solution would be to give the Administrator a form to configure this. In the back-end it would update the constants with the process IDs for all the processes it needs to kick off at the end of the LDAP sync nightly process.
  • 0
    Certified Senior Developer
    in reply to Jason Ruvinsky
    Basically, in order for it to be able to be deployed as a common application to different environments, I can't have any dependencies on process models from other applications that may or may not exist on the target environment.
  • You can try custom picker. Following is SAIL recepie code for custom picker that I modified to update for process models (Appian version 16.3):

    =load(
    local!pickedprocessModels: {},
    local!processModelLabels: index(getprocessmodelsbyfolder(32,a!pagingInfo(startIndex:1,batchSize:4 )),"name"),
    local!processModelAbbreviations: index(getprocessmodelsbyfolder(32,a!pagingInfo(startIndex:1,batchSize:4 )),"id"),
    a!formLayout(
    firstColumnContents: {
    a!pickerFieldCustom(
    label: "Process Models",

    maxSelections: 3,
    suggestFunction: rule!test_filterRule(filter: _, labels: local!processModelLabels, identifiers: local!processModelAbbreviations),
    selectedLabels: if(
    count(local!pickedprocessModels) = 0,
    null,
    apply(
    rule!test_FilterDisplayRule(identifier: _, labels: local!processModelLabels, identifiers: local!processModelAbbreviations),
    local!pickedprocessModels
    )
    ),
    value: local!pickedprocessModels,
    saveInto: local!pickedprocessModels
    ),
    a!textField(
    label: "Selected Data",
    value: toprocessmodel(local!pickedprocessModels),
    readOnly: true
    )
    }
    )
    )

    Note: getprocessmodelsbyfolder is a custom function which returns all the details of process models in a folder. You can use constants of type process model and text with uuids instead but then you'll have dependency on the models.
  • 0
    Certified Senior Developer
    in reply to rishirajk
    Thanks, that's a good potential solution. Is getprocessmodelsbyfolder available as a plugin on Forum?
  • Unfortunately it's an internal plugin and I don't have access to the plugin jar. But you can develop the plugin by using following plugin source code as reference :
    forum.appian.com/.../summary

    Following is the link of the API interface where you'll be able to find the methods to implement this plugin

    docs.appian.com/.../ProcessDesignService.html