I have a simple approach for you regarding this requirement, you can add a Parameter lets say ActivityName with default value "ActivityA" in ActivityA activity. Now in your ActivityB you can reference ActivityName parameter to get the parent activity name.
The field for defining a default for the parameter seems to be explicitely a string literal. I tried putting property references there and when I go to call ActivityB the default shows as the literal string, not the property value. So as far as I can tell this approach won't work. Thank you for the suggestion though.
Oh I see what you're saying. That won't fit our needs though as it would require updating every activity that calls ActivityB.
My requrement is that every log message includes the activity name and other elements before the message. To ensure this I have created a standardized activity for logging that takes in the elements including the activity name and then logs the message. Taking the activity name in as a parameter is more work and error prone than setting it dynamically if that is possible.
I looked at the linked discussion but that uses a stack trace so it would be hard to implement and would negatively impact performance getting the stack and building a complex enough regex to pull out the right activity name for every log message.
So it looks like just using a param that ActivityA will have to pass is the easiest and most maintainable option.
If we have a activity that is getting called from multiple places in the application and we do not want to pass a parameter from each of the activities that we call this activity from, we can write a small java code to get the name of the calling activity.