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
5 replies
Subscribers
7 subscribers
Views
7750 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
How to interrogate a type "Reaction Tree"
steveb
over 7 years ago
I've created an expression rule to call a!startProcess(). When I run an adhoc test on it the output Type is "Reaction Tree" and Value is "Smart Service". Can someone explain how I interrogate the output as I want to be able to check the values in statusCode, response and responseMessage.
The expression rule
with(
a!startProcess(
processModel: cons!MONITORING_RESPONSE_WEBAPI,
processParameters: {
businessKey: "Test",
demandName: "Increment",
endDateTime: now(),
processRegistryId: 0,
serviceMonitorId: generateUUID(),
startDateTime: now(),
transactionUUID: generateUUID(),
userid: "Demand API",
webAPIName: "createDemandAPI"
},
onSuccess: a!httpResponse(
statusCode: 200,
headers: {
a!httpHeader(name: "Content-Type", value: "application/json")
},
body: a!toJson(
...
OriginalPostID-272911
Discussion posts and replies are publicly visible
0
steveb
over 7 years ago
... {
response: "SUCCESS",
responseMessage: "Success"
}
)
),
onError: a!httpResponse(
statusCode: 500,
headers: {
a!httpHeader(name: "Content-Type", value: "application/json")
},
body: a!toJson(
{
response: "FAILURE",
responseMessage: "There was an error starting the process"
}
)
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
@steveb whenever we start a process using Expression Rule or Web-API, generally it's response will be of type ReactionTree, please confirm, are you looking for extracting the PVs from the process instance which you have started through your expression rule?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
steveb
over 7 years ago
@aloks176, I'm using the expression rule in a web API.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 7 years ago
@steveb if you want to extract process variable(PVs) values from the Process then you can get it from the Reaction tree as below:
fv!processInfo.pv.yourProcessVariable
But try doing this in the expression rule so that will be returned to WEB-API, instead of doing directly in WEB-API because when i did this in WEB-API last time, i got the error but while doing the same in Expression rule, was just fine.
Again i am not sure whether you looking for getting the Process Variables values only, or something else,
Please let me know if you are looking for something else to get from this process in WEB-API instead on PVs
Cancel
Vote Up
-1
Vote Down
Sign in to reply
Verify Answer
Cancel
0
steveb
over 7 years ago
@aloks176, thanks for your help :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel