Remember that while the Integration Server is built on Java, the abstraction level of Flow removes much of the power (and complexity) of lower level languages in an effort to implement a “visual data transformation” development environment.
While there is nothing that prevents a Flow service from invoking itself, there is a fundamental problem with doing recursion in flow:
The pipeline!
In 3gls like Java, when you enter a method/procedure, you get a new stack frame that allows you to create temporary variables that exist for only the lifetime of the method/procedure call and have no visibility outside it.
There is no such capability with the pipeline, because everything added to it has global visibility. So in your situation, a recursively invoked flow service has no way to create a new Assembly object that contains one of the subassemblies of the BOM that is “private” to one invocation of the service.
If your problem really requires a recursive solution, I think you will want to write a Java service.
#webMethods#Flow-and-Java-services#Integration-Server-and-ESB