需要并行调用三个webflow状态

发布于 2024-12-07 14:53:30 字数 2151 浏览 0 评论 0原文

我们的应用程序面临着严重的性能问题。当我们使用 webflow 时,我们需要向后端发送三个不同的请求,并且我们将它们一一发送,这会导致相当长的屏幕加载时间。

我们可以并行调用 webflow 的三种状态,以便能够并行向后端发送三个请求吗?或者有什么方法可以加载我们的屏幕并稍后调用一两个方法?

我们需要从retrieveAccInsList视图状态导航到accSummary视图状态,但在这之间我需要向backenf发送三个不同的请求,因为AccSumary屏幕包含3个屏幕合并,所以我需要来自三个不同地方的数据。但这是必需的解决方案

<view-state id="retrieveAccInsList">
    <transition on="openAccount" to="detailForAccountAction">
        <set name="conversationScope.selectedAccount" value="reqSearchHandler.selectedAccIns" />
        <set name="reqSearchHandler.objectToRetrieveCd" value="'RequestSearch'" />
    </transition>
</view-state>

<action-state id="detailForAccountAction">
    <evaluate expression="accountDetail.getDetailsForAccount(ClientDetailRq)"
        result="flowScope.response">
        <attribute name="name" value="detailAccountResponse" />
    </evaluate>
    <transition on="detailAccountResponse.success" to="searchNoteAction" />
    <transition on="detailAccountResponse.error" to="retrieveAccInsList" />
</action-state>

<action-state id="searchNoteAction">
    <evaluate expression="certNotesHandler.searchForNotes()"
        result="flowScope.response">
        <attribute name="name" value="noteResponse" />
    </evaluate>
    <transition on="noteResponse.success" to="searchActivityAction" />
    <transition on="noteResponse.error" to="retrieveAccInsList" />
</action-state>

<action-state id="searchActivityAction">
    <set name="reqSearchHandler.requestStatus" value="'O'" />
    <set name="reqSearchHandler.objectToRetrieveCd" value="'RequestSearch'" />
    <evaluate expression="reqSearchHandler.setparam()" />
    <evaluate expression="reqSearchHandler.searchForRequest(ReqInquireRq)"
        result="flowScope.response">
        <attribute name="name" value="activtiyResponse" />
    </evaluate>
    <transition on="activtiyResponse.success" to="accSummary" />
    <transition on="activtiyResponse.error" to="retrieveAccInsList" />
</action-state

We are facing serious performance issues in our application. We need to send three different requests to our backend, when we are using webflow and we are sending them one by one and this is leading to considerable screen loading time.

Can we call three states of webflow in parallel so that we are able to send three requests to our backend in parallel? Or is there any way to load our screen and call one or two methods later?

we need to navigate from retrieveAccInsList view state to accSummary view state but in between i need to send three different Request to backenf as AccSumary screen contain 3 screen merged,so i need data from three different places.but is the required solution

<view-state id="retrieveAccInsList">
    <transition on="openAccount" to="detailForAccountAction">
        <set name="conversationScope.selectedAccount" value="reqSearchHandler.selectedAccIns" />
        <set name="reqSearchHandler.objectToRetrieveCd" value="'RequestSearch'" />
    </transition>
</view-state>

<action-state id="detailForAccountAction">
    <evaluate expression="accountDetail.getDetailsForAccount(ClientDetailRq)"
        result="flowScope.response">
        <attribute name="name" value="detailAccountResponse" />
    </evaluate>
    <transition on="detailAccountResponse.success" to="searchNoteAction" />
    <transition on="detailAccountResponse.error" to="retrieveAccInsList" />
</action-state>

<action-state id="searchNoteAction">
    <evaluate expression="certNotesHandler.searchForNotes()"
        result="flowScope.response">
        <attribute name="name" value="noteResponse" />
    </evaluate>
    <transition on="noteResponse.success" to="searchActivityAction" />
    <transition on="noteResponse.error" to="retrieveAccInsList" />
</action-state>

<action-state id="searchActivityAction">
    <set name="reqSearchHandler.requestStatus" value="'O'" />
    <set name="reqSearchHandler.objectToRetrieveCd" value="'RequestSearch'" />
    <evaluate expression="reqSearchHandler.setparam()" />
    <evaluate expression="reqSearchHandler.searchForRequest(ReqInquireRq)"
        result="flowScope.response">
        <attribute name="name" value="activtiyResponse" />
    </evaluate>
    <transition on="activtiyResponse.success" to="accSummary" />
    <transition on="activtiyResponse.error" to="retrieveAccInsList" />
</action-state

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别挽留 2024-12-14 14:53:30

当然;使用阿贾克斯。但如果没有更多细节,很难说——为什么需要“并行”调用三个 Webflow 状态?之所以称为“流”,是因为它们是线性的(至少在一次对话中;我知道您可以同时激活多个流)。

Sure; use Ajax. But without further details it's tough to say--why would you need to call three webflow states "in parallel"? It's called "flow" because they're linear (at least within a single conversation; I know you can have multiple flows active at once).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文