Author Message
MCDeveloper
Joined: Jun 29, 2015
Messages: 66
Offline
Hi,

I have a main application executing a reusable module. Is there a way to know, from the reusable module which is the name of the calling module? For instance:

ModuleA answers the call
ModuleA executes moduleB
Can moduleB know the name of ModuleA?

And if I have a couple of nested reusables, like:
ModuleA answers the call
ModuleA executes moduleB
moduleB executes moduleC

can moduleC access ModuleA's name?

thank you
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
The "call history" may be helpful here. The call history is not a call stack, but rather a history of nodes visited in the application.


@Override
public void requestBegin(SCESession mySession) {
StackUnsynchronized<String>values = mySession.getCallStack();
values.forEach((v)->{
System.err.println("Item : " + v);
});
}


In a simple app produced:


Item : /AMain/Start
Item : /AMain/untitledData1
Item : /AMain/AMod1
Item : /AMod/Start
Item : /AMod/untitledData1
Item : /AMod/BMod1
Item : /BMod/Start
Item : /BMod/untitledData1
Item : /BMod/AMod1
Item : /AMod/Start
Item : /AMod/untitledData1
Item : /AMod/BMod1
Item : /BMod/Start
Item : /BMod/untitledData1


This app has a main with 2 modules that call each other while counting to a value.
MCDeveloper
Joined: Jun 29, 2015
Messages: 66
Offline
Thank you Ross!
That worked.

Go to:   
Mobile view