我在 weblogic 上使用 JSF (Primeface) 和 j2ee。
所以,我的应用程序中有两个不同的流程:
流量配置:
public class RequestFlow implements Serializable {
@Produces
@FlowDefinition
public Flow defineFlow(@FlowBuilderParameter FlowBuilder flowBuilder) {
String flowId = "requestFlow";
flowBuilder.id("", flowId);
flowBuilder.viewNode(flowId, "/inside/customer/request/flow/requestFlow.xhtml").markAsStartNode();
flowBuilder.viewNode("requestFlowCart", "/inside/customer/request/flow/requestFlowCart.xhtml");
flowBuilder.viewNode("requestFlowCheckout", "/inside/customer/request/flow/requestFlowCheckout.xhtml");
flowBuilder.returnNode("finishRequest").fromOutcome("/inside/customer/request/requests.xhtml");
return flowBuilder.getFlow();
}
}
CDI的流豆:
@Named
@FlowScoped("requestFlow")
public class RequestFlowBean implements Serializable {
//some logic
}
第二种配置:
公共类 OrderFlow 实现 Serializable {
@Produces
@FlowDefinition
public Flow defineFlow(@FlowBuilderParameter FlowBuilder flowBuilder) {
String flowId = "orderFlow";
flowBuilder.id("", flowId);
flowBuilder.viewNode(flowId, "/inside/customer/order/flow/orderFlow.xhtml").markAsStartNode();
flowBuilder.viewNode("orderFlowSelectRequests", "/inside/customer/order/flow/orderFlowSelectRequests.xhtml");
flowBuilder.viewNode("orderFlowReviewRequests", "/inside/customer/order/flow/orderFlowReviewRequests.xhtml");
flowBuilder.viewNode("orderFlowCheckoutOrder", "/inside/customer/order/flow/orderFlowCheckoutOrder.xhtml");
flowBuilder.returnNode("finishOrder").fromOutcome("/inside/customer/order/orders.xhtml");
return flowBuilder.getFlow();
}
}
CDI的流豆:
@Named
@FlowScoped("orderFlow")
public class OrderFlowBean implements Serializable {
//some logic
}
我的情况:
用户打开页面,通过单击 h:button 启动“requestFlow”(没有完成它!)
使用菜单导航到另一个页面,通过单击 h:button 尝试启动“orderFlow”。
问题:“OrderFlow”在控制台中没有任何错误启动!第一个流程仍在内存中,但根据文档,它必须被销毁。
所以,我希望能够在另一个没有完成时创建一个新的 FlowScoped bean。
有什么建议么?