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
8 replies
Subscribers
7 subscribers
Views
2031 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Does anyone know what the easiest and most cost-efficient method would be to che
nickw
over 10 years ago
Does anyone know what the easiest and most cost-efficient method would be to check if a given process ID exists? I have a list of processID's I'm passing to my SmartService as a Long array, and I need to iterate through it and remove any ID's that are invalid. Thanks!...
OriginalPostID-97074
OriginalPostID-97074
Discussion posts and replies are publicly visible
0
aayusha
Certified Senior Developer
over 10 years ago
One way can be Use the Execute process Report Smart Service on a report (containing all the valid process Ids) and save it in a long array now check whether your ids (used in SS) does exists in the new array or not.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 10 years ago
Can you explain what your use case is? Where would you get the invalid id's from? Is this related to archived processes?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
nickw
over 10 years ago
An interesting idea about using the report but that seems excessive. Is there some sort of low cost function I can call and possibly catch on InvalidProcessException? If it generates that exception, then I know the process doesn't exist.
And to answer your question Sathya, user error.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aayusha
Certified Senior Developer
over 10 years ago
Another way can be When the actual instance is created, you would be saving data to a external db. Here you can also save the process instance id. Now you just have use a query to check whether that particular (that you wanna check) exists or not.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 10 years ago
Why are users dealing with process Id? Can you explain a bit more on this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
nickw
over 10 years ago
We have users that manually create csv documents with job ids in them. Since it is done manually, there is the potential for human error. We had to implement our system this way in order to give our users the desired functionality.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aayusha
Certified Senior Developer
over 10 years ago
yes, Sathya's point is correct. If you want user to have some unique identifier for his/her process instance create a sequence generator for each request of particular process. That way user fill feel more friendly to use the application and may decrease chances of error. Though you can always design to crosscheck.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sathya Srinivasan
Appian Employee
over 10 years ago
Ok. Few things to keep in mind. Mixing user activity with process identifier could lead to challenges that you've just mentioned. Especially if users need to refer to a very long number and retype in a CSv file.
If you must associate the two, then you should consider having a process that does this for the end user, thus avoiding manual intervention.
Having said that, your option is to use the analytic smart service ootb or processanalytis API call which actually does the same in the background.
Finally, I can't emphasize the importance of getting your architecture right from day 1 so you have great processes.....
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel