This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
dvanoni
Posts: 37 Joined: Wed Dec 02, 2015 3:47 am
Location: Chiasso - Switzerland
Post
by dvanoni » Fri Oct 21, 2016 5:37 pm
Hi all!
is it possible to set a srvroutine in a "Failed" state programmatically?
Thanks
For example:
Code: Select all
Srvroutine Name(my_srvroutine)
if cond(some_condition)
* Set "Failed" state
Return
endif
Endroutine
Mthroutine Name(my_mthroutine)
Define_com Class(#MySrvModule.my_srvroutine) Name(#my_srvroutine)
my_srvroutine.Execute
Evtroutine Handling(my_srvroutine.Completed)
Endroutine
Evtroutine Handling(my_srvroutine.Failed)
Endroutine
Endroutine
MarkD
Posts: 692 Joined: Wed Dec 02, 2015 9:56 am
Post
by MarkD » Fri Oct 21, 2016 5:54 pm
dannyoorburg
Posts: 177 Joined: Mon Jan 04, 2016 9:50 am
Location: Australia
Post
by dannyoorburg » Fri Oct 21, 2016 6:29 pm
But wouldn't it be so much more graceful to return a field with some sort of result code that has meaning within your application....
Danny
dvanoni
Posts: 37 Joined: Wed Dec 02, 2015 3:47 am
Location: Chiasso - Switzerland
Post
by dvanoni » Fri Oct 21, 2016 6:42 pm
It works using the "Abort" command!
Thanks a lot!