0
votes

Eclipse marks this error

cvc-complex-type.2.4.a: Invalid content was found starting with element 'action-state'. One of '{"http://www.springframework.org/schema/webflow":on-end, "http://www.springframework.org/schema/webflow":output, "http://www.springframework.org/schema/webflow":exception-handler, "http://www.springframework.org/schema/webflow":bean-import}' is expected.

on this flow code

<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
    http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd" 
abstract="true">


<global-transitions>
    <transition on="logIn" to ="login" />
    <transition on="signup" to="signup"/>
    <transition on="logOut" to="logout"/>
</global-transitions>

<action-state id="logout">
    <evaluate expression="login.logout(currentUser)" />
    <transition on="successLogout" to="main" />
    <transition on="failLogout" to="error" />
</action-state>

I only find action-state samples and everyone are writting like my code and people use the same XSD. Either, I have read XSD file and on action-state section tag evaluate is missing. Why eclipse marks this error?

Thanks in advance!

1
Now, I have edited because I copied incorrect code, sorry :)Rafael Ruiz Tabares

1 Answers

1
votes

I think there has to be an order in which the elements are defined. Try defining the action-state before the global-transitions. If you hover your mouse pointer over the "flow" xml definition in your xml file this info appears (among others):

Content Model : (attribute*, secured?, persistence-context?, var*, input*, on-start?, (action-state | view-state | decision-state | subflow-state | end-state)*, global-transitions?, on-end?, output*, exception-handler*, bean-import*)

So, there is a strict sequence.