I've configured User Input Task in a process where I've used an Interface in which I'm using StartProcess smart service to invoke a process, Please find the code snippet below:
a!buttonWidget( label: "Approve1", saveInto: { a!startProcess( processModel: cons!PA_ProcessConstant(), processParameters: { currentWorkstep: local!currentWorkstep, temp: "Test Param", workCount: local!workstepCount, worksteps: local!worksteps }, onSuccess: a!save( local!outPut, "Process started successfully" ), onError: a!save(local!outPut, "Process failed to start") ) }, submit: true, style: "PRIMARY", showWhen: { if(ri!workstepcount = 0, false, true) } )
The above code is resulting in the error as shown below:
If I will comment the saveInto parameter of buttonWidget from the above code snippet the interface works fine. Please let me know If there is any issue in the code.
Discussion posts and replies are publicly visible
Is there a specific reason to start a process in a submit button?
Yes, Based on condition I want to have another User Input Task in the process I will be executing from Interface.
That's a bad idea. Why not just add some more nodes to the process?
If I will add User Input Task with Multiple Instances in a process, that will not work for me here. as number of times I want to execute the User Input Task depends on User's response from the previous User Input Task. so I will have to decide that on runtime. If this is not the right way to achieve this then can you please suggest a better way to implement this.
Using MNI, you can assign a task to as many users and/or groups as you want.
https://docs.appian.com/suite/help/23.2/looping.html#multi-node-instances
Yes I can assign the task to users and groups, but my concern here is, I don't have count that how many times I need to generate Task from that process, that is the reason I am invoking a process on submit which has a User Input Task. For MNI I need to provide a count(Which is dynamic) or an array of object(as it is getting updated at runtime).
I am confused. I am sure you have some logic that determines how many tasks you need. And you should be able to use that number or list for the MNI configuration.
But, maybe you explain what you actually want to achieve, and there might be a more Appian-like option.
Hi,
I have recreated the scenario. Can you remove the parentheses from process model's constant and try again? PFA for your reference. Thanks!