i understand that currentEvent has attributes.. but don't know how the attributes created.. so that I may able to see its members..
i've this in the SWF documentation... where the guest came from?
e.g. currentEvent.attributes.guest
i understand that currentEvent has attributes.. but don't know how the attributes created.. so that I may able to see its members..
i've this in the SWF documentation... where the guest came from?
e.g. currentEvent.attributes.guest
Last edited by eros; Apr 27th, 2010 at 10:31 PM. Reason: tag as SOLVED
Eros
Environment:
JSP 2.0
Dojo 1.4.1
Ext JS 3.1 (testing)
Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
STS
SWF 2.0.9.RELEASE
Tiles 2.0.5
iBatis: ibatis-sqlmap-2.3.4.726
I take it you're looking at this page?
"guest" is an output attribute returned by the subflow. It should be defined as the output of the subflow's end state.
Take a look at the bookingConfirmed end-state at the bottom of the page. Notice it has an output with the name "bookingId". In a similar fashion, if that flow is called as a subflow, and the subflow returns through that end-state, then "bookingId" will be available through: currentEvent.attributes.bookingId.
Hope that helps.
i tried my best to understand the flow but unfortunately, due to lack of knowledge.. wasn't able to understand...
where current.attributes.guest came from?
Code:<view-state id="reviewBooking"> <transition on="addGuest" to="addGuest" /> <transition on="confirm" to="bookingConfirmed" /> <transition on="revise" to="enterBookingDetails" /> <transition on="cancel" to="bookingCancelled" /> </view-state> <subflow-state id="addGuest" subflow="createGuest"> <transition on="guestCreated" to="reviewBooking"> <evaluate expression="booking.guests.add(currentEvent.attributes.guest)" /> </transition> <transition on="creationCancelled" to="reviewBooking" /> </subflow-state>
Eros
Environment:
JSP 2.0
Dojo 1.4.1
Ext JS 3.1 (testing)
Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
STS
SWF 2.0.9.RELEASE
Tiles 2.0.5
iBatis: ibatis-sqlmap-2.3.4.726
What makes this hard, I think, is that the example doesn't show you the "createGuest" flow which is being invoked in the "addGuest" subflow.
However, in the "createGuest" flow definition, you can assume that it has a "creationCancelled" end-state and a "guestCreated" end-state. You may assume this because the names of the end-states need to match the names of the transitions in the subflow-state ("addGuest").
Furthermore, you may assume that within the "guestCreated" end-state in the "createGuest" flow, it maps an output attribute named "guest". This is what allows subflows to return information to their calling flows, and why you can use "currentEvent.attributes.guest". The output attributes in end-states are accessible in this way.
If you want to see an output attribute in action, look at the bottom of that page. See the "bookingConfirmed" end-state? Notice how it has an output of "bookingId"? That means that if that flow is called as a subflow, and it reaches the "bookingConfirmed" end-state, the booking ID of the new booking is reachable in the calling flow using "currentEvent.attribute.bookingId".
Eros
Environment:
JSP 2.0
Dojo 1.4.1
Ext JS 3.1 (testing)
Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
STS
SWF 2.0.9.RELEASE
Tiles 2.0.5
iBatis: ibatis-sqlmap-2.3.4.726