JSR352 decide next step based on return parameter from Decider

蹲街弑〆低调 提交于 2019-12-24 10:44:11

问题


I would like to implement a Decider that returns the ID of the next step that needs to be executed. (This question is related to my other question here if you would like to know why I'm trying to do this: JEE Batch Job Specification with many optional Steps)

<decision id="decider1" ref="skipNextStepDecider">
    <properties>
        <property name="condition" value="isExecuteSteps"/>
    </properties>
    <next on="*" to="STEP_ID_RETURNED_BY_DECIDER"/>
    <end on="SKIP"/>
</decision>

Is there any way to do this? I am using JSR352 with Websphere Liberty in case this is relevant.

UPDATE

My intent was to avoid the following:

<decision id="decider1" ref="skipNextStepDecider">
    <properties>
        <property name="condition" value="isExecuteSteps"/>
    </properties>
    <next on="STEP1" to="step1"/>
    <next on="STEP2" to="step2"/>
    <next on="STEP3" to="step3"/>
    <end on="SKIP"/>
</decision>

回答1:


To do this you'd need to know the possible target steps ahead of time...

The JSL gets parsed up front (mostly) so there's nothing you can put in the 'to' value that would resolve with a result from the step/decider processing.

Might be an interesting spec update possibility.



来源:https://stackoverflow.com/questions/59214372/jsr352-decide-next-step-based-on-return-parameter-from-decider

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!