Announcement Announcement Module
Collapse
No announcement yet.
<method-result> "scope" attribute query Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • <method-result> "scope" attribute query

    This web flow state produces the exception below; the problem is scope="flow" on the <method-result> element. Without it the flow executes. Thanks.

    <action-state id="lookupIssue">
    <bean-action bean="issuesManager" method="getIssueById">
    <method-arguments>
    <argument expression="${flowScope.id}"/>
    </method-arguments>
    <method-result name="issue" scope="flow"/>
    </bean-action>
    <transition on="success" to="viewIssue"/>
    </action-state>

    org.springframework.binding.convert.ConversionExce ption: No converter registered to convert from sourceClass 'class java.lang.String' to target class 'class org.springframework.webflow.execution.ScopeType'
    org.springframework.binding.convert.support.Generi cConversionService.getConversionExecutor(GenericCo nversionService.java:158)
    org.springframework.webflow.engine.builder.BaseFlo wBuilder.fromStringTo(BaseFlowBuilder.java:152)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseScope(XmlFlowBuilder.java:883)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseActionResultExposer(XmlFlowBuilde r.java:843)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseMethodResultExposer(XmlFlowBuilde r.java:834)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseBeanInvokingAction(XmlFlowBuilder .java:804)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseAnnotatedBeanInvokingAction(XmlFl owBuilder.java:795)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseAnnotatedActions(XmlFlowBuilder.j ava:758)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseAndAddActionState(XmlFlowBuilder. java:643)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseAndAddStateDefinitions(XmlFlowBui lder.java:613)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.buildStates(XmlFlowBuilder.java:350)
    org.springframework.webflow.engine.builder.FlowAss embler.directAssembly(FlowAssembler.java:149)
    org.springframework.webflow.engine.builder.FlowAss embler.assembleFlow(FlowAssembler.java:131)
    org.springframework.webflow.engine.builder.Refresh ableFlowDefinitionHolder.assembleFlow(RefreshableF lowDefinitionHolder.java:173)
    org.springframework.webflow.engine.builder.Refresh ableFlowDefinitionHolder.getFlowDefinition(Refresh ableFlowDefinitionHolder.java:93)
    org.springframework.webflow.definition.registry.Fl owDefinitionRegistryImpl.getFlowDefinition(FlowDef initionRegistryImpl.java:128)
    org.springframework.webflow.engine.builder.Default FlowServiceLocator.getSubflow(DefaultFlowServiceLo cator.java:79)
    org.springframework.webflow.engine.builder.xml.Loc alFlowServiceLocator.getSubflow(LocalFlowServiceLo cator.java:119)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseSubflow(XmlFlowBuilder.java:740)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseAndAddSubflowState(XmlFlowBuilder .java:663)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.parseAndAddStateDefinitions(XmlFlowBui lder.java:622)
    org.springframework.webflow.engine.builder.xml.Xml FlowBuilder.buildStates(XmlFlowBuilder.java:350)
    org.springframework.webflow.engine.builder.FlowAss embler.directAssembly(FlowAssembler.java:149)
    org.springframework.webflow.engine.builder.FlowAss embler.assembleFlow(FlowAssembler.java:131)
    org.springframework.webflow.engine.builder.Refresh ableFlowDefinitionHolder.assembleFlow(RefreshableF lowDefinitionHolder.java:173)
    org.springframework.webflow.engine.builder.Refresh ableFlowDefinitionHolder.getFlowDefinition(Refresh ableFlowDefinitionHolder.java:93)
    org.springframework.webflow.definition.registry.Fl owDefinitionRegistryImpl.getFlowDefinition(FlowDef initionRegistryImpl.java:128)
    org.springframework.webflow.executor.FlowExecutorI mpl.launch(FlowExecutorImpl.java:204)
    org.springframework.webflow.executor.support.FlowR equestHandler.handleFlowRequest(FlowRequestHandler .java:131)
    org.springframework.webflow.executor.mvc.FlowContr oller.handleRequestInternal(FlowController.java:17 2)
    org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:153)
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:48)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:861)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:795)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:476)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:431)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:689)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)

  • #2
    Which id youn are expecting as a parameter

    Comment


    • #3
      You can just try this as follows


      Code:
      <view-state id="currentState" view="currentView">
      <transition on="currentEvent" to="currentSubFlow" >
      			<set attribute="id" value="${requestParameters.Id}" scope="flow"/>
      		</transition>
      
      </view-state>
      
      <subflow-state id="currentSubFlow" flow="currentInlineFlow">
      		<transition on="finish" to="someWhereUNeed" />
      	</subflow-state>
      
      <inline-flow id="currentInlineFlow">
      		<flow>
      			<start-state idref="currentFlow" />
      			
      			
      			<action-state id="lookupIssue">
                                <bean-action bean="issuesManager" method="getIssueById">
                                  <method-arguments>
                                     <argument expression="${flowScope.id}"/>
                                 </method-arguments>
                                 <method-result name="issue" scope="flow"/>
                            </bean-action>
                          <transition on="success" to="viewIssue"/>
                      </action-state> 
      			<end-state id="viewIssue" />
      		</flow>
      	</inline-flow>


      or u can try this way




      Code:
      <input-mapper>
              <input-attribute name="id"/>
          </input-mapper> 
      
         ...................
      
      <view-state id="currentViewId" view="currentView">
              
      	  <transition on="*" to="lookupIssue"/>	
      	</view-state>
      <action-state id="lookupIssue">
                                <bean-action bean="issuesManager" method="getIssueById">
                                  <method-arguments>
                                     <argument expression="${flowScope.id}" parameter-type="int"/>
                                 </method-arguments>
                                 <method-result name="issue"/>
                            </bean-action>
                          <transition on="success" to="viewIssue"/>
                      </action-state>
      <view-state id="viewIssue" view="sadf">
      ..........
      </view-state>

      In the jsp or any view u need to do as

      Code:
      <input value="Save" class="btn" name="_eventId_save" type="submit">
      <input type="hidden" name="id" value="${model.id}" />

      Comment

      Working...
      X