Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
6 replies
Subscribers
9 subscribers
Views
4852 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Do we have an option to invoke a process model from SAIL Code?
Navajith K
over 9 years ago
Do we have an option to invoke a process model from SAIL Code?
OriginalPostID-154018
OriginalPostID-154018
Discussion posts and replies are publicly visible
0
Alok Mohare
Appian Employee
over 9 years ago
The Start Process Writer Shared Component should help you with that.
forum.appian.com/.../summary
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
siddharthm
over 9 years ago
Yes.. We can invoke a process model from the SAIL using the function 'startprocesswrite' with the 'bind' function
Eg: local!invokeProcess:bind(
{
valueToBePassedToProcess:null
},
startprocesswrite(
processModelId: ## /* Process Model Id of the process that has to be invoked */,
processParameters: _
)
)
You can use this local variable(local!invokeProcess) to invoke the process model from the SAIL. Say you want to pass a 'Name' field from the SAIL to the process model on clicking a button, the sample code will be like below :
a!buttonWidget(
label: "Submit",
style: "PRIMARY",
value: {
valueToBePassedToProcess:ri!name
},
saveInto: {
local!invokeProcess << _,
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Navajith K
over 9 years ago
Thank you Alok and Siddharth, I will give it a try.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stewart Burchell
Appian Employee
over 9 years ago
Note: the model will be invoked asynchronously and will not pass you back any results. If you're needing to get output you can, for example. get it to create asynchronous content e.g. a Task or an email.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike Schmitt
Certified Lead Developer
over 9 years ago
I'd note that even though the process fires asynchronously, my tests have revealed that if the process is set to chain through, then any DB updates it performs will be done before the SAIL form's With() parameters (if any) are reloaded.
I have successfully used this trick to create, for example, a "star" icon on a Record dashboard which is actually a graphic link, which when clicked, adds a bookmark row in the DB for that user/record pair, and the form updates in realtime with a filled-in star to indicate "bookmarked". Again, it *is* dependent on process chaining, at least per my tests.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike James
Certified Lead Developer
over 9 years ago
+1 for this neat chaining trick!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel