daddygames
daddygames

Reputation: 1928

Spring Webflow Subflow - Referenced Flow Cannot be Found

I have all of my flow documents under /WEB-INF/pageFlows.

<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices" base-path="/WEB-INF/pageFlows">
    <webflow:flow-location-pattern value="/**/*-flow.xml"/>
</webflow:flow-registry>

When using Eclipse's type-ahead feature on the subflow property of the subflow element, I can see a list of the flows that I have included in my project... except that it only loads half of the flows I actually have in the project. Any flow that is not on that type-ahead list creates an ERROR warning in Eclipse.

So now I have several errors reported in my project when there isn't actually any error. I'd like to get rid of these error messages. Any suggestions for resolving these reference errors?

The error messages read like this: "Referenced flow [flow-name] cannot be found"

Upvotes: 2

Views: 1303

Answers (3)

user7152981
user7152981

Reputation:

This is a BUG of Spring validation.

You can disable the "Sub Flow State Rule" validator to remove it.

See the screenshots below.

screenshot-1 screenshot-2

Upvotes: 1

Arnaud Kleinveld
Arnaud Kleinveld

Reputation: 101

It's indeed a bug. Your configuration is good. As long as you use the path between your base-path and the filename as your flow identifier you refer to in the subflow attribute of your subflow element. Find detailed explanation in section 10 of the webflow documentation.

I use "/**/flow.xml" as a flow-location-pattern and my Eclipse's type-ahead provides me only with the filename (flow.xml) as a suggestion. It should actually detect the path part between the base path and the file names and show me a list of that.

I managed to temporarily remove the wrongly annotated errors by removing the sub-flow element, saving the file and re-typing the sub-flow element.

After removing the sub-flow element and saving the file the error disappears.

After typing back the sub-flow element the error does not reappear.

The error reappears after a clean & build. Then repeat the above to make it disappear.

I am currently working with Eclipse 4.4

Upvotes: 0

Prasad
Prasad

Reputation: 3795

As per your flow registry flow definitions:

1) make sure all your flow definition files are under WEB-INF/pageFlows and

2) all your flow file names are ending in -flow.xml

Upvotes: 0

Related Questions