In the previous article Production rule systems were employed to define behavior of frontend UI. In this one I'll show how to use Hierarchical Task Networks (HTN) to define dynamic behavior of an API (or in other words workflows). Find out more about HTN in this free Game AI Pro chapter Exploring HTN Planners through Example.
So what is wrong (or missing) in most API definitions nowadays whether it is some contract defined via Java interface or REST API described via Swagger? They define operations but lack definition of workflows or how with the help of the operations provided achieve your goal. Find below how this might be done.
So what is wrong (or missing) in most API definitions nowadays whether it is some contract defined via Java interface or REST API described via Swagger? They define operations but lack definition of workflows or how with the help of the operations provided achieve your goal. Find below how this might be done.