Data / Create job executions
Task in alpha phase
This Data Factory task is in phase. You can contact the Product-Live team at contact@product-live.com if you want more details and get an early access.
This task allows to create job executions. Creating a job execution triggers the execution of a job, running all its tasks in sequence.
Task name:
Examples
json
{
"name": "data-job-execution-create",
"taskReferenceName": "create_job_execution",
"description": "Create a job execution",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"request": {
"method": "INLINE",
"contentType": "application/json",
"model": "default",
"json": {
"operations": [
{
"key": "a",
"element": {
"object": "job-execution-create",
"jobKey": "MY_JOB"
}
}
]
}
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
json
{
"name": "data-job-execution-create",
"taskReferenceName": "create_job_execution",
"description": "Create a job execution",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"request": {
"method": "ATTACHMENT",
"contentType": "application/xml",
"model": "default",
"file": "@my-request.xml"
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Definition
| Property | Type | Required | Description |
|---|---|---|---|
| The name (or type) of the task | |||
| The unique name of the task in your job. It is used to reference this task in the workflow. | |||
| The functional description of this task in your job. | |||
The type of the task. It must be SUB_WORKFLOW. | |||
| : | true: the job continues if there is an error on this task. false: the job fails. | ||
| Input parameters of the task. See below |
Inputs Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| The Product-Live API key. If not provided, an automaticaly generated API key will be used to perform the request on behalf of the current user. If provided, the given API key will be used to perform the request. | |||
| See below | |||
To day, application/json and application/xml are supported. | |||
INLINE: The request body is provided inline in the request object. ATTACHMENT: The request body is provided as an attachment in the request object. | |||
| The request body as a JSON object. | |||
| See below | |||
| A unique key to identify the element in the batch. This key will be associated to the element in the output. | |||
| The element to create or update. See examples below | |||
| Some element may require additional context to be created or updated. | |||
| The request body as a file. | |||
| The outputs of the request. Default: [{"mediaType": "application/json", "outputMode": "INLINE", "outputKey": "json"}]. | |||
The media type of the output. To day, application/json and application/xml are supported. | |||
INLINE: The output is provided inline in the output object. ATTACHMENT: The output is provided as an attachment in the output object. INLINE is only supported for mediaType=application/json | |||
| The key of the output. Either json or xml | |||
Default: DEFAULT. The model/format used in the output. To day, only 'DEFAULT' is supported. |
contentType=application/json
- The expected elements are the entities described in the Product-Live API.
- See examples below for more details.
json
{
"operations": [
{
"key": "a",
"element": {
"...": "..."
}
}
]
}1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
json
{
"operations": [
{
"key": "a",
"element": {
"...": "..."
}
}, {
"key": "b",
"element": {
"...": "..."
}
}
]
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Job execution element properties
| Property | Type | Required | Description |
|---|---|---|---|
Must be job-execution-create when specified | |||
The ID of the job to execute. Required if jobKey is not provided | |||
The key of the job to execute. Required if jobId is not provided | |||
| Additional information for the job execution | |||
| A title for the job execution | |||
| Input parameters to pass to the job |
contentType=application/xml
- This XML representation follow the one used by the JSON query language of the Product-Live API.
- The expected elements are the entities described in the Product-Live API.
- See examples below for more details.
xml
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.w3.org/2005/xpath-functions">
<array key="operations">
<map>
<string key="key">a</string>
<map key="context"></map>
<map key="element">
<string key="...">...</string>
</map>
</map>
</array>
</map>1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Outputs
| Property | Type | Description |
|---|---|---|
An object containing the outputs of the task. Each output key is the key of the output defined in the outputs[][outputKey] input parameter. |
Example
If your input parameters is as follows:
json
{
"...": "...",
"outputs": [
{
"mediaType": "application/json",
"outputMode": "INLINE",
"outputKey": "json_inline"
},
{
"mediaType": "application/xml",
"outputMode": "ATTACHMENT",
"outputKey": "xml_attachment"
}
]
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
The output will be as follows:
json
{
"outputs": {
"json_inline": {
"...": "...",
"...": "..."
},
"xml_attachment": {
"url": "..."
}
}
}1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Json output - outputs[].outputMode=INLINE and outputs[].mediaType=application/json
output.jsonis an array of objects as defined in the job executions API.jsonis the default output key but may be changed by setting theoutputKeyproperty.
XML output - outputs[].outputMode=ATTACHMENT and outputs[].mediaType=application/xml
Limits and additional notes
- When the
outputMode=INLINEis selected, the maximum number of elements returned by this task is limited to1000. If more elements are to be returned, the task ends with an error. To export up to the maximum of elements, use thelimitinput parameter to limit the number of elements return.
Additional examples
Create a single job execution - XML input & output
job.json
json
{
"name": "data-job-execution-create",
"taskReferenceName": "create_job_execution",
"description": "Create a single job execution",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"request": {
"method": "ATTACHMENT",
"contentType": "application/xml",
"model": "default",
"file": "@my-request.xml"
},
"outputs": [
{
"mediaType": "application/xml",
"outputMode": "ATTACHMENT",
"outputKey": "xml"
}
]
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
my-request.xml
xml
<?xml version="1.1" encoding="UTF-8"?>
<map xmlns="http://www.w3.org/2005/xpath-functions">
<array key="operations">
<map>
<string key="key">a</string>
<map key="context"></map>
<map key="element">
<string key="object">job-execution-create</string>
<string key="jobKey">MY_JOB</string>
</map>
</map>
</array>
</map>1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
Create many job executions - XML input & output
job.json
json
{
"name": "data-job-execution-create",
"taskReferenceName": "create_job_executions",
"description": "Create many job executions",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"request": {
"method": "ATTACHMENT",
"contentType": "application/xml",
"model": "default",
"file": "@my-request.xml"
},
"outputs": [
{
"mediaType": "application/xml",
"outputMode": "ATTACHMENT",
"outputKey": "xml"
}
]
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
my-request.xml
xml
<?xml version="1.1" encoding="UTF-8"?>
<map xmlns="http://www.w3.org/2005/xpath-functions">
<array key="operations">
<map>
<string key="key">a</string>
<map key="context"></map>
<map key="element">
<string key="object">job-execution-create</string>
<string key="jobKey">MY_JOB_1</string>
</map>
</map>
<map>
<string key="key">b</string>
<map key="context"></map>
<map key="element">
<string key="object">job-execution-create</string>
<string key="jobKey">MY_JOB_2</string>
</map>
</map>
</array>
</map>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Create a single job execution - JSON input & output
job.json
json
{
"name": "data-job-execution-create",
"taskReferenceName": "create_job_execution",
"description": "Create a single job execution",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"request": {
"method": "ATTACHMENT",
"contentType": "application/json",
"model": "default",
"file": "@my-request.json"
},
"outputs": [
{
"mediaType": "application/json",
"outputMode": "ATTACHMENT",
"outputKey": "json"
}
]
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
my-request.json
json
{
"operations": [
{
"key": "a",
"context": {},
"element": {
"object": "job-execution-create",
"jobKey": "MY_JOB"
}
}
]
}1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Create many job executions - JSON input & output
job.json
json
{
"name": "data-job-execution-create",
"taskReferenceName": "create_job_executions",
"description": "Create many job executions",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"request": {
"method": "ATTACHMENT",
"contentType": "application/json",
"model": "default",
"file": "@my-request.json"
},
"outputs": [
{
"mediaType": "application/json",
"outputMode": "ATTACHMENT",
"outputKey": "json"
}
]
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
my-request.json
json
{
"operations": [
{
"key": "a",
"context": {},
"element": {
"object": "job-execution-create",
"jobKey": "MY_JOB_1"
}
},
{
"key": "b",
"context": {},
"element": {
"object": "job-execution-create",
"jobKey": "MY_JOB_2"
}
}
]
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Create job execution using job ID with input parameters
job.json
json
{
"name": "data-job-execution-create",
"taskReferenceName": "create_job_execution_with_input",
"description": "Create a job execution with input parameters",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"failOnError": true,
"request": {
"method": "INLINE",
"contentType": "application/json",
"model": "default",
"json": {
"operations": [
{
"key": "a",
"element": {
"jobId": "12345",
"info": {
"title": "Automated job execution"
},
"input": {
"customParameter1": "value1",
"customParameter2": "value2"
}
}
}
]
}
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Create job execution using dynamic job key from previous task
job.json
json
{
"name": "data-job-execution-create",
"taskReferenceName": "trigger_dependent_job",
"description": "Trigger a dependent job based on previous task output",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"failOnError": true,
"request": {
"method": "INLINE",
"contentType": "application/json",
"model": "default",
"json": {
"operations": [
{
"key": "a",
"element": {
"jobKey": "${workflow.input.targetJobKey}",
"info": {
"title": "Job triggered from parent workflow"
},
"input": {
"sourceJobId": "${workflow.workflowId}",
"processedItems": "${previous_task.output.itemCount}"
}
}
}
]
}
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32