Announcement Announcement Module
Collapse
No announcement yet.
where is the documentation of currentEvent? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • where is the documentation of currentEvent?

    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, 10:31 PM. Reason: tag as SOLVED

  • #2
    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.

    Comment


    • #3
      Originally posted by InverseFalcon View Post
      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>

      Comment


      • #4
        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".

        Comment


        • #5
          Originally posted by InverseFalcon View Post
          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".
          Thank you very much Sir InverseFalcon.... its very clear..hoping that this information will also be included in the webflow documentation..

          Comment

          Working...
          X