You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@batchee.apache.org by "Reinhard Sandtner (JIRA)" <ji...@apache.org> on 2017/03/20 18:51:41 UTC

[jira] [Assigned] (BATCHEE-117) Restart after a Decision Stop is not getting called

     [ https://issues.apache.org/jira/browse/BATCHEE-117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reinhard Sandtner reassigned BATCHEE-117:
-----------------------------------------

    Assignee: Reinhard Sandtner

> Restart after a Decision Stop is not getting called
> ---------------------------------------------------
>
>                 Key: BATCHEE-117
>                 URL: https://issues.apache.org/jira/browse/BATCHEE-117
>             Project: BatchEE
>          Issue Type: Bug
>            Reporter: Ashwanth
>            Assignee: Reinhard Sandtner
>         Attachments: decision.zip
>
>
> I am using It looks like when the decider class returns a String that should result in a "Stop", the exit status on the stop condition is getting set correctly but the restart step is not getting called by the framework. 
> In my example, MyDecider class returns "stop", the exit status is successfully set to "Stopped on decider1" but step3 is not getting invoked. My understanding is that step3 will be invoked automatically by the batch implementation. 
> If my understanding on the functionality is incorrect, please reject this jira.
> {noformat}
> Maven Dependency:
> <dependency>
>     	<groupId>org.apache.batchee</groupId>
>     	<artifactId>batchee-jbatch</artifactId>
>     	<version>0.4-incubating</version>
> 	</dependency>
> JSL:
> <?xml version="1.0" encoding="UTF-8"?>
> <job id="bigbangdecision" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd" version="1.0">
>     <step id="step1" next="decider1">
>         <batchlet ref="myBatchlet1"/>
>     </step>
>     <decision id="decider1" ref="myDecider">
>         <fail on="fail" exit-status="Failed on decider1"/>
>         <end on="end" exit-status="Completed on decider1"/>
>         <stop on="stop" exit-status="Stopped on decider1" restart="step3"/>
>         <next on="*" to="step3"/>
>     </decision>
>     <step id="step2">
>         <batchlet ref="myBatchlet2"/>
>     </step>
>     <step id="step3">
>         <batchlet ref="myBatchlet3"/>
>     </step>
> </job>
> Decide Class:
> package gov.iowa.wd.ui.tax.batch.job.bigbang.decision;
> import javax.batch.api.Decider;
> import javax.batch.runtime.StepExecution;
> import javax.inject.Named;
> @Named
> public class MyDecider implements Decider {
>     @Override
>     public String decide(StepExecution[] ses) throws Exception {
>     	String decision = "stop";
>         for (StepExecution se : ses) {
>             System.out.println(se.getStepName() + " " + se.getBatchStatus().toString() + " " + se.getExitStatus());
>         }
>     	System.out.println("Returning Decision: " + decision);
>         return decision;
>     }
> }
> MyBatchlet3 (Step 3) class:
> package gov.iowa.wd.ui.tax.batch.job.bigbang.decision;
> import javax.batch.api.AbstractBatchlet;
> import javax.inject.Named;
> @Named
> public class MyBatchlet3 extends AbstractBatchlet {
>     @Override
>     public String process() {
>         System.out.println("Running inside a batchlet 3");
>         return "COMPLETED";
>     }
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)