是否可以在 DHF 流文件中使用令牌替换?
Is it possible to use token replacements in DHF flow files?
在 MarkLogic 10.0-3 上,使用 ml-data-hub 插件 5.2.1,我想在部署到各种环境时在流程的映射步骤中指定可变源和目标数据库(saliman.properties 插件 1.4 .6) 基于mlAppName
属性,例如:
[...snip, snip...]
"2" : {
"name" : "myStep",
"description" : "a step in my flow",
"options" : {
"additionalCollections" : [ ],
"sourceQuery" : "cts.collectionQuery([\"targetCollection\"])",
"mapping" : {
"name" : "MyFlow-myStep",
"version" : 0
},
"targetEntity" : "MyEntity",
"sourceDatabase" : "%%mlAppName%%-STAGING",
"collections" : [ "myStep", "MyEntity" ],
"permissions" : "data-hub-operator,read,data-hub-operator,update",
"validateEntity" : false,
"sourceCollection" : "sourceCollection",
"outputFormat" : "json",
"targetDatabase" : "%%mlAppName%%-FINAL"
},
"customHook" : {
"module" : "",
"parameters" : { },
"user" : "",
"runBefore" : false
},
"retryLimit" : 0,
"batchSize" : 100,
"threadCount" : 4,
"stepDefinitionName" : "entity-services-mapping",
"stepDefinitionType" : "MAPPING"
},
[...snip, snip...]
但是,令牌替换不会发生。这是不可能的,还是有更好的最佳实践方法来实现它?谢谢
很遗憾,目前尚不支持。在加载文档后,您必须使用自定义 Gradle 任务来操作文档的内容。请在 DHF github 项目中创建一个票证来请求此功能,这是一个值得添加的功能。
在 MarkLogic 10.0-3 上,使用 ml-data-hub 插件 5.2.1,我想在部署到各种环境时在流程的映射步骤中指定可变源和目标数据库(saliman.properties 插件 1.4 .6) 基于mlAppName
属性,例如:
[...snip, snip...]
"2" : {
"name" : "myStep",
"description" : "a step in my flow",
"options" : {
"additionalCollections" : [ ],
"sourceQuery" : "cts.collectionQuery([\"targetCollection\"])",
"mapping" : {
"name" : "MyFlow-myStep",
"version" : 0
},
"targetEntity" : "MyEntity",
"sourceDatabase" : "%%mlAppName%%-STAGING",
"collections" : [ "myStep", "MyEntity" ],
"permissions" : "data-hub-operator,read,data-hub-operator,update",
"validateEntity" : false,
"sourceCollection" : "sourceCollection",
"outputFormat" : "json",
"targetDatabase" : "%%mlAppName%%-FINAL"
},
"customHook" : {
"module" : "",
"parameters" : { },
"user" : "",
"runBefore" : false
},
"retryLimit" : 0,
"batchSize" : 100,
"threadCount" : 4,
"stepDefinitionName" : "entity-services-mapping",
"stepDefinitionType" : "MAPPING"
},
[...snip, snip...]
但是,令牌替换不会发生。这是不可能的,还是有更好的最佳实践方法来实现它?谢谢
很遗憾,目前尚不支持。在加载文档后,您必须使用自定义 Gradle 任务来操作文档的内容。请在 DHF github 项目中创建一个票证来请求此功能,这是一个值得添加的功能。