Skip to content

Commit 7f38bca

Browse files
Merge pull request mendix#8871 from strategicalliances/mdl-trigger-ingestion-job-docs
Update mendix-data-loader.md
2 parents 9ece4d1 + e187d75 commit 7f38bca

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

content/en/docs/appstore/use-content/platform-supported-content/modules/snowflake/mendix-data-loader.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,38 @@ To view all ingestion jobs associated with a specific data source in Snowflake,
102102
SELECT * FROM core.ingestion_job WHERE DATASOURCE_ID = '1234abcd' ORDER BY CREATED_DATE_TIME DESC;
103103
```
104104

105+
## Programmatically Trigger an Ingestion From a Mendix App
106+
107+
Programmatically triggering an ingestion job can meet data ingestion requirements where a scheduled task may not. This includes cases such as waiting for a last submission to be submitted to a Mendix app before data ingestion occurs. Another example case is to start data ingestion when the load on the Mendix app is the lowest.
108+
109+
### Prerequisites
110+
- A fully configured data source in the Mendix Data Loader
111+
- A Mendix app equipped with the Snowflake REST SQL connector
112+
- An authenticated user that is allowed to trigger stored procedures
113+
114+
To trigger an ingestion job programmatically, use the `ExecuteStatement` operation available in the Snowflake REST SQL connector. The statement to be executed has the following syntax.
115+
116+
```sql
117+
CALL {NAME_OF_THE_MENDIX_DATA_LOADER}.MX_FUNCTIONS.RUN_INGESTION_JOB('{DATASOURCE_ID}','{TASK_ID}');
118+
```
119+
120+
- The default name for the Mendix Data Loader is `MENDIX_DATA_LOADER`
121+
- Data source ID is a required parameter
122+
- Task ID is an optional parameter
123+
124+
To find the data source ID for a given data source:
125+
1. Navigate to the Snowflake environment
126+
2. Open the Mendix Data Loader; Data Products -> Apps -> Mendix Data Loader
127+
3. Open the application by clicking the `MENDIX_DATA_LOADER` tab
128+
4. Click *View* on the configured data source
129+
5. Copy the value for the `ID` key
130+
131+
For a data source with the ID *40FJYP9D*, the resulting statement will be.
132+
133+
```sql
134+
CALL MENDIX_DATA_LOADER.MX_FUNCTIONS.RUN_INGESTION_JOB('40FJYP9D','');
135+
```
136+
105137
## Verifying the Access Token
106138

107139
When using OAuth authentication with the Mendix Data Loader, it is crucial to verify the access token received by your Mendix application. This verification process ensures the token's authenticity and integrity, protecting your application from unauthorized access attempts.

0 commit comments

Comments
 (0)