value){
/**
*
- * xml name: maxCount
- * 读取的最大记录数,缺省值为-1,表示不限制
+ * xml name: maxCountExpr
+ *
*/
- public java.lang.Long getMaxCount(){
- return _maxCount;
+ public io.nop.core.lang.eval.IEvalAction getMaxCountExpr(){
+ return _maxCountExpr;
}
- public void setMaxCount(java.lang.Long value){
+ public void setMaxCountExpr(io.nop.core.lang.eval.IEvalAction value){
checkAllowChange();
- this._maxCount = value;
+ this._maxCountExpr = value;
}
@@ -270,7 +270,7 @@ protected void outputJson(IJsonHandler out){
out.putNotNull("filePath",this.getFilePath());
out.putNotNull("filter",this.getFilter());
out.putNotNull("headers",this.getHeaders());
- out.putNotNull("maxCount",this.getMaxCount());
+ out.putNotNull("maxCountExpr",this.getMaxCountExpr());
out.putNotNull("newRecordInputProvider",this.getNewRecordInputProvider());
out.putNotNull("resourceIO",this.getResourceIO());
out.putNotNull("resourceLoader",this.getResourceLoader());
@@ -290,7 +290,7 @@ protected void copyTo(BatchFileReaderModel instance){
instance.setFilePath(this.getFilePath());
instance.setFilter(this.getFilter());
instance.setHeaders(this.getHeaders());
- instance.setMaxCount(this.getMaxCount());
+ instance.setMaxCountExpr(this.getMaxCountExpr());
instance.setNewRecordInputProvider(this.getNewRecordInputProvider());
instance.setResourceIO(this.getResourceIO());
instance.setResourceLoader(this.getResourceLoader());
diff --git a/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchGeneratorModel.java b/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchGeneratorModel.java
new file mode 100644
index 000000000..603b122ab
--- /dev/null
+++ b/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchGeneratorModel.java
@@ -0,0 +1,107 @@
+package io.nop.batch.dsl.model._gen;
+
+import io.nop.commons.collections.KeyedList; //NOPMD NOSONAR - suppressed UnusedImports - Used for List Prop
+import io.nop.core.lang.json.IJsonHandler;
+import io.nop.batch.dsl.model.BatchGeneratorModel;
+import io.nop.commons.util.ClassHelper;
+
+
+
+// tell cpd to start ignoring code - CPD-OFF
+/**
+ * generate from /nop/schema/task/batch.xdef
+ *
+ */
+@SuppressWarnings({"PMD.UselessOverridingMethod","PMD.UnusedLocalVariable",
+ "PMD.UnnecessaryFullyQualifiedName","PMD.EmptyControlStatement","java:S116","java:S101","java:S1128","java:S1161"})
+public abstract class _BatchGeneratorModel extends io.nop.core.resource.component.AbstractComponentModel {
+
+ /**
+ *
+ * xml name: genModelPath
+ *
+ */
+ private java.lang.String _genModelPath ;
+
+ /**
+ *
+ * xml name: totalCountExpr
+ *
+ */
+ private io.nop.core.lang.eval.IEvalAction _totalCountExpr ;
+
+ /**
+ *
+ * xml name: genModelPath
+ *
+ */
+
+ public java.lang.String getGenModelPath(){
+ return _genModelPath;
+ }
+
+
+ public void setGenModelPath(java.lang.String value){
+ checkAllowChange();
+
+ this._genModelPath = value;
+
+ }
+
+
+ /**
+ *
+ * xml name: totalCountExpr
+ *
+ */
+
+ public io.nop.core.lang.eval.IEvalAction getTotalCountExpr(){
+ return _totalCountExpr;
+ }
+
+
+ public void setTotalCountExpr(io.nop.core.lang.eval.IEvalAction value){
+ checkAllowChange();
+
+ this._totalCountExpr = value;
+
+ }
+
+
+
+ @Override
+ public void freeze(boolean cascade){
+ if(frozen()) return;
+ super.freeze(cascade);
+
+ if(cascade){ //NOPMD - suppressed EmptyControlStatement - Auto Gen Code
+
+ }
+ }
+
+ @Override
+ protected void outputJson(IJsonHandler out){
+ super.outputJson(out);
+
+ out.putNotNull("genModelPath",this.getGenModelPath());
+ out.putNotNull("totalCountExpr",this.getTotalCountExpr());
+ }
+
+ public BatchGeneratorModel cloneInstance(){
+ BatchGeneratorModel instance = newInstance();
+ this.copyTo(instance);
+ return instance;
+ }
+
+ protected void copyTo(BatchGeneratorModel instance){
+ super.copyTo(instance);
+
+ instance.setGenModelPath(this.getGenModelPath());
+ instance.setTotalCountExpr(this.getTotalCountExpr());
+ }
+
+ protected BatchGeneratorModel newInstance(){
+ return (BatchGeneratorModel) ClassHelper.newInstance(getClass());
+ }
+}
+ // resume CPD analysis - CPD-ON
diff --git a/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchLoaderModel.java b/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchLoaderModel.java
index 62c7119dc..b6af4eb95 100644
--- a/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchLoaderModel.java
+++ b/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchLoaderModel.java
@@ -44,6 +44,13 @@ public abstract class _BatchLoaderModel extends io.nop.batch.dsl.model.BatchList
*/
private io.nop.batch.dsl.model.BatchFileReaderModel _fileReader ;
+ /**
+ *
+ * xml name: generator
+ *
+ */
+ private io.nop.batch.dsl.model.BatchGeneratorModel _generator ;
+
/**
*
* xml name: jdbc-reader
@@ -148,6 +155,25 @@ public void setFileReader(io.nop.batch.dsl.model.BatchFileReaderModel value){
}
+ /**
+ *
+ * xml name: generator
+ *
+ */
+
+ public io.nop.batch.dsl.model.BatchGeneratorModel getGenerator(){
+ return _generator;
+ }
+
+
+ public void setGenerator(io.nop.batch.dsl.model.BatchGeneratorModel value){
+ checkAllowChange();
+
+ this._generator = value;
+
+ }
+
+
/**
*
* xml name: jdbc-reader
@@ -234,6 +260,8 @@ public void freeze(boolean cascade){
this._fileReader = io.nop.api.core.util.FreezeHelper.deepFreeze(this._fileReader);
+ this._generator = io.nop.api.core.util.FreezeHelper.deepFreeze(this._generator);
+
this._jdbcReader = io.nop.api.core.util.FreezeHelper.deepFreeze(this._jdbcReader);
this._ormReader = io.nop.api.core.util.FreezeHelper.deepFreeze(this._ormReader);
@@ -249,6 +277,7 @@ protected void outputJson(IJsonHandler out){
out.putNotNull("aggregator",this.getAggregator());
out.putNotNull("bean",this.getBean());
out.putNotNull("fileReader",this.getFileReader());
+ out.putNotNull("generator",this.getGenerator());
out.putNotNull("jdbcReader",this.getJdbcReader());
out.putNotNull("ormReader",this.getOrmReader());
out.putNotNull("saveState",this.getSaveState());
@@ -268,6 +297,7 @@ protected void copyTo(BatchLoaderModel instance){
instance.setAggregator(this.getAggregator());
instance.setBean(this.getBean());
instance.setFileReader(this.getFileReader());
+ instance.setGenerator(this.getGenerator());
instance.setJdbcReader(this.getJdbcReader());
instance.setOrmReader(this.getOrmReader());
instance.setSaveState(this.getSaveState());
diff --git a/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchTaskModel.java b/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchTaskModel.java
index cd04d7b3a..8d4aee9cd 100644
--- a/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchTaskModel.java
+++ b/nop-batch/nop-batch-dsl/src/main/java/io/nop/batch/dsl/model/_gen/_BatchTaskModel.java
@@ -185,6 +185,13 @@ public abstract class _BatchTaskModel extends io.nop.core.resource.component.Abs
*/
private io.nop.batch.core.BatchTransactionScope _transactionScope ;
+ /**
+ *
+ * xml name: useBatchRequestGenerator
+ *
+ */
+ private boolean _useBatchRequestGenerator = false;
+
/**
*
* xml name: allowStartIfComplete
@@ -720,6 +727,25 @@ public void setTransactionScope(io.nop.batch.core.BatchTransactionScope value){
}
+ /**
+ *
+ * xml name: useBatchRequestGenerator
+ *
+ */
+
+ public boolean isUseBatchRequestGenerator(){
+ return _useBatchRequestGenerator;
+ }
+
+
+ public void setUseBatchRequestGenerator(boolean value){
+ checkAllowChange();
+
+ this._useBatchRequestGenerator = value;
+
+ }
+
+
@Override
public void freeze(boolean cascade){
@@ -777,6 +803,7 @@ protected void outputJson(IJsonHandler out){
out.putNotNull("taskName",this.getTaskName());
out.putNotNull("taskVersion",this.getTaskVersion());
out.putNotNull("transactionScope",this.getTransactionScope());
+ out.putNotNull("useBatchRequestGenerator",this.isUseBatchRequestGenerator());
}
public BatchTaskModel cloneInstance(){
@@ -812,6 +839,7 @@ protected void copyTo(BatchTaskModel instance){
instance.setTaskName(this.getTaskName());
instance.setTaskVersion(this.getTaskVersion());
instance.setTransactionScope(this.getTransactionScope());
+ instance.setUseBatchRequestGenerator(this.isUseBatchRequestGenerator());
}
protected BatchTaskModel newInstance(){
diff --git a/nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/BatchGenConstants.java b/nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/BatchGenConstants.java
index dfcd92dc7..7b7bfc450 100644
--- a/nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/BatchGenConstants.java
+++ b/nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/BatchGenConstants.java
@@ -7,12 +7,18 @@
*/
package io.nop.batch.gen;
+import io.nop.batch.core.BatchConstants;
+
public interface BatchGenConstants {
String MODEL_TYPE_BATCH_GEN = "batch-gen";
String FILE_TYPE_GEN_JSON = "batch-gen.json";
String FILE_TYPE_GEN_JSON5 = "batch-gen.json5";
String FILE_TYPE_GEN_YAML = "batch-gen.yaml";
- String VAR_CHUNK_CONTEXT = "chunkContext";
+ String POSTFIX_BATCH_GEN_XLSX = ".batch-gen.xlsx";
+
+ String XDSL_BATCH_GEN_IMP_PATH = "/nop/batch/imp/batch-gen.imp.xml";
+
+ String VAR_CHUNK_CONTEXT = BatchConstants.VAR_BATCH_CHUNK_CTX;
String VAR_CHUNK_RESPONSE = "response";
}
diff --git a/nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/loader/BatchGenLoader.java b/nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/loader/BatchGenLoaderProvider.java
similarity index 80%
rename from nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/loader/BatchGenLoader.java
rename to nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/loader/BatchGenLoaderProvider.java
index 013a857e4..988ecf6d2 100644
--- a/nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/loader/BatchGenLoader.java
+++ b/nop-batch/nop-batch-gen/src/main/java/io/nop/batch/gen/loader/BatchGenLoaderProvider.java
@@ -7,6 +7,8 @@
*/
package io.nop.batch.gen.loader;
+import io.nop.api.core.convert.ConvertHelper;
+import io.nop.api.core.exceptions.NopException;
import io.nop.batch.core.IBatchChunkContext;
import io.nop.batch.core.IBatchLoaderProvider;
import io.nop.batch.core.IBatchTaskContext;
@@ -16,24 +18,21 @@
import io.nop.batch.gen.generator.BatchGenState;
import io.nop.batch.gen.model.BatchGenModel;
import io.nop.batch.gen.model.BatchGenModelParser;
+import io.nop.core.lang.eval.IEvalAction;
import java.util.ArrayList;
import java.util.List;
-public class BatchGenLoader extends AbstractBatchResourceHandler
+public class BatchGenLoaderProvider extends AbstractBatchResourceHandler
implements IBatchLoaderProvider