Skip to content

Commit 39652d7

Browse files
committed
Removed flow-type as it is not required
1 parent ca38c62 commit 39652d7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ Then import the project into eclipse
4343
####Available Transforms
4444
Data Hub has provided several transforms that can be used when installed along with the created entities and flows in the MarkLogic server.
4545
####run-flow
46-
This transform can be used to run the flow when inserting document. It accepts the following `entity-name`, `flow-name` and `flow-type`.
46+
This transform can be used to run the flow when inserting document. It accepts the following `entity-name` and `flow-name`.
4747

4848
#####Use Cases:
4949

5050
1. Using [MarkLogic REST API PUT /v1/documents](http://docs.marklogic.com/REST/PUT/v1/documents)
5151

52-
`curl --anyauth --user <user>:<password> -X PUT -T <documentDirectory> -H "Content-type:<contentType>" 'http://<mlHost>:<port>/<version>/documents?uri=<uri>&transform=run-flow&trans:entity-name=<entityName>&trans:flow-name=<flowName>&trans:flow-type=<flowType>'`
52+
`curl --anyauth --user <user>:<password> -X PUT -T <documentDirectory> -H "Content-type:<contentType>" 'http://<mlHost>:<port>/<version>/documents?uri=<uri>&transform=run-flow&trans:entity-name=<entityName>&trans:flow-name=<flowName>'`
5353

5454
Example:
5555

@@ -61,7 +61,7 @@ Example:
6161

6262
To insert/update this document with uri '/employee1.xml' into the database 'data-hub-in-a-box-STAGING' (with host 'localhost' and port '8010'), given a user 'admin' with password 'admin' and rest-writer role AND to be able to run the flow 'IngestFlow' of the 'Customer' entity, run the following:
6363

64-
`curl --anyauth --user admin:admin -X PUT -T ./documents/employee1.xml -H "Content-type:application/xml" 'http://localhost:8010/LATEST/documents?uri=/employee1.xml&transform=run-flow&trans:entity-name=Customer&trans:flow-name=IngestFlow&trans:flow-type=input'`
64+
`curl --anyauth --user admin:admin -X PUT -T ./documents/employee1.xml -H "Content-type:application/xml" 'http://localhost:8010/LATEST/documents?uri=/employee1.xml&transform=run-flow&trans:entity-name=Customer&trans:flow-name=IngestFlow'`
6565

6666
This will create a document with uri '/employee1.xml'. The content will depend on the data format of the entity.
6767

marklogic-data-hub/src/main/resources/ml-modules/transforms/run-flow.xqy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ declare function runFlow:transform(
1313
{
1414
let $entityName := map:get($params, 'entity-name')
1515
let $flowName := map:get($params, 'flow-name')
16-
let $flowType := map:get($params, 'flow-type')
17-
18-
let $flow := flow:get-flow($entityName,$flowName,$flowType)
16+
17+
let $flow := flow:get-flow($entityName,$flowName,())
1918

2019
let $uri := map:get($context, 'uri')
2120

0 commit comments

Comments
 (0)