Topic
  • 2 replies
  • Latest Post - ‏2014-10-06T20:47:31Z by HaydenMc
HaydenMc
HaydenMc
9 Posts

Pinned topic How can I handle a macro timeout?

‏2014-08-05T23:33:05Z |

Hi

I've built a fairly complex macro, which is being called from a restful service.  The macro can't take into consideration all the possible options that might occur on the screens that it passes through - the logic & checks involved would just be too complex.  I am handling quite a few, and have success rates over 90%.  But that last 10% or so have situations where the macro times out.  And I'd like to handle this as well as I can.

Our restful service returns a 500 Internal Server error upon timeout.  Is one option to try to catch this in the integration object, or restful service java code?

Or is there a way to work a macro to introduce a transient "in case of timeout, do this" exit point?  (considering that there are already a number of transient screens involved in the macro)

I am hoping to introduce some sort of "catch-all" that can return back enough information to the user so that they can make a decision based on the error or the contents of the last screen, or something like that.  (we are extracting a before & after view of each screen for debugging, but a timeout doesn't let us return anything nice through the restful service)

Thanks

 - Hayden

  • george.baker
    george.baker
    315 Posts

    Re: How can I handle a macro timeout?

    ‏2014-10-03T18:37:49Z  

    This is a very difficult issue to solve.  I've thought of how this could be done, but I've never been able to come up with a fool proof design.

    In my opinion the only way you possibly can programmatically catch a totally unexpected screen and gracefully exit would be to use the transient screen.  I personally do not believe it will work, but I've never put it to a serious test.  For this to work the test for a transient screen must be performed after all other tests had been completed.  Then you must use a criteria that would always work.  Then you must know how to exit the macro.

    Without know why you would have so many paths I can only offer one other suggestion.  Validate the data before invoking the macro, or within the macro before submitting to the host.  Many of these types of errors are a result of invalid data.

     

  • HaydenMc
    HaydenMc
    9 Posts

    Re: How can I handle a macro timeout?

    ‏2014-10-06T20:47:31Z  

    This is a very difficult issue to solve.  I've thought of how this could be done, but I've never been able to come up with a fool proof design.

    In my opinion the only way you possibly can programmatically catch a totally unexpected screen and gracefully exit would be to use the transient screen.  I personally do not believe it will work, but I've never put it to a serious test.  For this to work the test for a transient screen must be performed after all other tests had been completed.  Then you must use a criteria that would always work.  Then you must know how to exit the macro.

    Without know why you would have so many paths I can only offer one other suggestion.  Validate the data before invoking the macro, or within the macro before submitting to the host.  Many of these types of errors are a result of invalid data.

     

    Thanks George.

    I really can't believe that there isn't a way to handle this through the integration objects or anything like that even.  It seems ridiculous, considering the type of job a macro is doing.  A macro is working on top of another interface - which has been there for 40 years, and had modifications to it over that 40 years, with a pile of different business rules added & subtracted over that time.  The complexity & expense of making changes to that mainframe process is now the only driving factor of us using HATS, and there is no way that we would be able to handle all situations 100% correctly.

    I agree that data is most likely the cause, but to validate every piece of data on every screen is a huge task that a HATS macro doesn't have a very good interface for.  And then all we'd be doing would be re-writing all the business rules in macro or java.  It's not practical.  What would be more practical would be for HATS to call an event or something when the macro times out - something that we can check for in the integration object so that we can at least return some information about what has happened to the macro.

    Cheers