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
10 replies
Subscribers
7 subscribers
Views
5076 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Administration
Is there a function I can use to identify which Appian instance a process is run
paule
over 9 years ago
Is there a function I can use to identify which Appian instance a process is running in - so that we can have different behaviour in test environments from the production environment?
OriginalPostID-204408
OriginalPostID-204408
Discussion posts and replies are publicly visible
0
mohammedz
Certified Senior Developer
over 9 years ago
Hi Paule,
You can create a Portal Report, passing Main Process Model as context and select check box of include sub process . Add a column in portal report under data tab for task Id. So when ever your flow is running assigned task id's will be logged in portal report.
You can use QueryProcessAnalytics to get the task id for the Active tasks by passing any Unique Id for your flow.
This will work only if you have any unique parameter field like caseId, orderId etc...
(OR)
getactivetaskidsforprocess . using this function if you pass processId it will return all active task id .. From that task id you can get the Appian Instance name and whatever you want from Portal Reprot
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
siddharthg837
over 9 years ago
Hi Paule, In order to identify the which Appian instance your process runs one, ie, weather its an DEV, Test or Production site and if you are using "Record" in your application - you can make use of an out of the box function available named - "urlforrecord" that returns the unique url of the record that has the domain name in it . The output of this function can be parsed and can be used to identify which instance it is.
The link for the above function from the product documentation:
forum.appian.com/.../Scripting_Functions.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eliot Gerson
Appian Employee
over 9 years ago
In addition to the other suggestions, you can simply create a constant and check the value of the constant. This would be pretty easy to do and very performance friendly, and effort-wise, would only require creating a single, simple constant in each environment.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
paule
over 9 years ago
Thank you for taking the trouble to respond. I particularly like the urlforrecord solution.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
We have a rule named along the lines of isDevelopmentEnvironment, which looks something like this:
= with(
local!siteURL: lower(
rule!APN_getSiteUrl()
),
or(
find(
"dev",
local!siteURL
),
find(
"test",
local!siteURL
)
)
)
In case you don't have the Appian common objects installed, the rule APN_getSiteUrl just does extract(linktodocument(0, "doc"), """", "doc/")
Obviously this relies on your environments having some element of the URL that allows you to identify the environment...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
@Eliot That constant-based solution does work - but I've seen people deploy the constant from test to prod, which causes some interesting behaviour :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
I should add that we don't differentiate between dev and test as there aren't matching integration environments for both dev and test - only test.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jacob Rank
Appian Employee
over 9 years ago
Here's a complete writeup:
forum.appian.com/.../Environment_Specific_Properties.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
paule
over 9 years ago
The problem of moving a constant from test to prod is exactly why I'm looking for a solution that uses something that can't be altered by promoting the wrong constant. I was fortunate that Appian were able to do a point-in-time restore to before I promoted a constant I should not have done!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Lakshmi Meyyappan
over 9 years ago
If you look at the Appian playbook writeup that jacob.rank posted then you can implement a method that uses constants but will not suffer from the problem of mistakenly promoting the constant. All environment constants will be promoted and the APN_getSiteUrl rule will match it up to the correct value.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel