It appears that you are trying to access a session variable after the session has ended.
Maybe I need to do something to pass the session.jobStepArray to the component?
Like the argument might be: sessionScope.session.jobStepArray
...session.jobStepArray being the array I want to process in the CFC. I thought that since the session.jobStepArray already existed I would not need to "send" it to the function.
Read the docs, they will tell you all.
You can access shared scope variables as follows:
Thanks for the info. I have read about passing in the session scope but I am probably not thinking of this correctly.
What I mean is that the method that onSessionEnd calls in the cfc to write the data from the session.jobStepArray to the database already exists. So, I wrote a method that does not take any arguments. My concept was that I just want to write whats in the session array to the database and since the array already exists in session then the method will just act upon that array. Does it's thing. Then end.
It appears that my thinking is flawed in that I really do need to pass the session.jobStepArray as an argument to the method when calling the CFC.
And, I need to make sure that I've passed in the SessionScope and then send the argument of:
Arguments.SessionScope.session.jobStepArray to the component method.
Does that make sense anyone? (besides me)
It probably won't make any difference because the session will have ended. To test this put this into your onSessionEnd function.
<cfdump var = "#session#">
Dan, I'm trying it right now - had a meeting.
So, are you saying that there is not a way to get the session.jobStepArray values at/to onSessionEnd? Or ANY session values and do something with them at onSessionEnd. I'm stumped then.
Is there another method that you can suggest for this? That is other than writing each value to the database separately at the time of execution.
So, are you saying that there is not a way to get the session
Well... no. You're in the onSessionEND handler, so intrinsically the session has ended. That's the whole point.
However, you might want to read Owain's post, and then read the docs he pointed you do. That pretty much explains how it all works. But you do actually need to read the docs: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d 40.html
<cfinvoke component="/lib/components/jobState" method="giveMeAnswer" returnvariable="returnFromCfc">
I'm surprised that way of referencing a CFC works. You should be using dot notation, not giving CFINVOKE a path. This, though, has nothing to do with your issue, it's just an observation.