Why don’t you just put a flag somewhere (database, repository, memory, …) that indicates whether the service is currently running? Then as the first step in your service you check against this flag?
=====service layout=========
BRANCH "running"
true: SEQUENCE
EXIT from flow
false: SEQUENCE exit-on SUCCESS (try-catch)
SEQUENCE exit-on FAILURE (try)
set running = true
[service contents]
set running = false
SEQUENCE exit-on DONE (catch)
set running = false
============================
Make sure to have the try-catch block in there, because otherwise your service will be locked forever when an exception occurs.
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB