1

Step Definition is as below,

{
  "lang" : "zxx",
  "name" : "test_harmonization",
  "description" : "",
  "type" : "CUSTOM",
  "version" : 3,
  "options" : {
    "additionalCollections" : [ ],
    "sourceQuery" : "cts.andQuery([cts.collectionQuery([\"/type/collection\"]), cts.fieldWordQuery(\"project\", \"*projectId*\", [\"wildcarded\"]), cts.jsonPropertyValueQuery(\"Version\",\"projectVersionDate\")])",
    "targetEntity" : "",
    "collections" : [ "test_harmonization" ],
    "sourceDatabase" : "data-hub-STAGING",
    "sourceCollection" : "/type/collection",
    "outputFormat" : "json",
    "targetDatabase" : "data-hub-FINAL"
  },
  "customHook" : { },
  "modulePath" : "/custom-modules/custom/test_harmonization/main.sjs",
  "retryLimit" : 0,
  "batchSize" : 100,
  "threadCount" : 4
}

I am using below Gradle command to run the “test_flow” with step 4.

./gradlew hubRunFlow -PflowName=test_flow -PentityName=test -PbatchSize=100 -PthreadCount=4 -Psteps="4"  -PprojectId="TestProject" -PprojectVersionDate="2021-20" -PenvironmentName=dev -i

Error occurred after running above Gradle command,

* What went wrong:
Execution failed for task ':hubRunFlow'.
> Unable to read flow: Unexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)
   at [Source: (FileInputStream); line: 196, column: 18]

Here my requirement is, I want to pass the value of projectId and projectVersionDate from command line while running the flow.

DevNinja
  • 1,459
  • 7
  • 10

1 Answers1

1

@Shivling Bhandare you can use the parameter "options" to add custom parameters to your step modules.

options Receives a JSON structure containing key-value pairs to be passed as custom parameters to your step modules.

You can read more about this in https://docs.marklogic.com/datahub/5.8/flows/run-flow-using-gradle.html

ILM
  • 11
  • 2