Suppose you want to document a flow of calls to your API methods to achieve a goal, for example, the flow of methods to subsequently call in order to purchase a book in a library application. With @Api, @ApiMethod and @ApiObject you can document single methods but these methods will be likely used to perform complex actions. You can document API flows with the @ApiFlow annotation. For example:
The @ApiFlowSet annotation informs JSONDoc that the class contains a set of flows to be documented. Each flow is then declared on a method in the class using the @ApiFlow annotation, which has some properties to better document the flow, in particular the steps property, made of @ApiFlowStep annotations.
The apimethodid property is very important and mandatory, because it defines which method, documented with @ApiMethod, this step is referring to. Thus, if you want to document API flows, then you need to set the same id on both @ApiMethod and @ApiFlowStep. My suggestion is to put the IDs in a constants class, and refer those IDs in the two annotations. For example, here is an example class with IDs:
The value of these constants is not important. The important thing is that you have the same value on both the @ApiMethodid property and the @ApiFlowStepapimethodid property.