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
We implemented the following pattern for this. An API call passes the necessary data to Appian and starts a process. The API call returns the URL to the task. The other system forwards the user to this task.
Hi Stefan, thank you for your feedback. I was thinking about this possibility, but can we open a start form this way. Our intention is not to start the process instance but only open a start form from a link. Maybe I am not aware, but is there a function which can return a 'start form' task id if process instance is not started? End user can click the link in external system several times and we don't want to start the process instance each time, actually we want to start it if this first 'start form' is submitted.
Not directly. One option might be to use an embedded interface. Not sure about the restrictions in that specific case.
Ok, clear, thank you
Hi Stefan, how did you achieve this? We built an API which start the process, we chained the start node to the first user input task and we retrieve the task url in the api upon building the response.
This appears not to be working always. It appears to work fine 80% or the times, but sometimes it seems that the api builds the response before the process assignes the task!
Hm, we did not see this issue years ago. How do you obtain the task id?
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!
Hm ... Can you try to use a process report and queryProcessAnalytics instead of that plugin function?
We tried but the we still have the same error, occurring randomly. Here is the new code.
a!httpResponse( statusCode: 200, headers: { a!httpHeader(name: "Content-Type", value: "application/json") }, body: a!toJson({ taskUrl: a!urlfortask( taskIds: index(index(index(a!queryProcessAnalytics( report: cons!LM_TR_BY_PID, contextProcessIds: { index(index(fv!processInfo, "pp", null), "id", null) }, query: a!query(pagingInfo: a!pagingInfo(1,1)) ), "data", null), "c4", null), 1, null) ) }) )
The report that we are using is a task report of type "Tasks by process".