Getting the name of the current process or service flow

For logging purposes, it is sometimes useful to access the name of the process or service flow that contains the currently executing script.

Getting the name of the current process

You can get the name of the process that contains the current script by using the string expression tw.system.process.name.
Tip: If the current process was invoked by another process, you can use the string expression tw.system.currentProcess.name to get the name of the parent process.

Getting the name of the current service flow

For a script that is inside a service flow, you can get the name of the service flow by using the string expression tw.system.serviceFlow.name.