I'd like to conditionally execute code depending on whether I'm in a Workspace or Stored Process server context.
I could do this by testing the existence of an automatic STP variable, eg _metaperson, but this wouldn't be very robust.
Assuming I already have a metadata connection, how best to check my server type?
Hurrah - there is, in fact, an automatic variable that does just this -
sysprocessmode(available since 9.4)Extract from documentation:
Being an automatic variable, it is of course read only: