Start a process as an action from external URL

Certified Lead Developer

Hi,

is there any way we could start the process model with start form and pass some input parameters from external URL. We have a request where we will have to search some customers in external system, and pass the related customerId to appian process model which should open a start form. So the similar behavior as appian actions, but being called by using URL in external system and being able to pass some parameters to a start form which should be displayed on a link click.

For example, we have to search for a customer in external system. When we find a customer we need, we have to start an appian process for that particular customer only by clicking the http link in external system. Another requirement is to avoid starting the process instance if start form for particular customer is not submitted. So, for example, we find a customer with custId=1 in external system, we would like to generate some URL like http://appian.host/start_process/processModelId=2&custId=1 . Link should be opened in a new tab offering a process start form with the customerId being passed as a rule input. If we expose the process model as a web service, is there a way the endpoint opens the start form of the process model? What about security and authorization?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    We start the process with a!startProcess and we value the onSuccess parameter of that rule like this:

    a!httpResponse(
    statusCode: 200,
    headers: {
    a!httpHeader(name: "Content-Type", value: "application/json")
    },
    body: a!toJson({
    taskUrl: a!urlfortask(
    index(rule!LM_getTaskDetailsByPid(
    pid: index(index(fv!processInfo, "pp", null), "id", null)
    ), "taskId", null)
    )
    })
    )

    where rule!LM_getTaskDetailsByPid is a rule that, given a process id, retrieves the id of the active task of the process in the taskId component using a task report and query analytics.

    It seems that sometimes the system tries to evaluate LM_getTaskDetailsByPid before the process reached the user input task.

    Thank you very much for your help, really appreciated!

Children