Creating an Azure Data Factory Plug-in (in Detail)
This procedure describes how to create a plug-in that triggers an existing pipeline in Azure Data Factory.
This plug-in is a simplified version of the Control-M Integration plug-in available from BMC, Control-M for Azure Data Factory.
Begin
Adding the New Plug-in
This procedure describes how to create a new plug-in with just a few basic details. This procedure adds the new plug-in to your collection of plug-ins in Application Integrator and prepares it for you to populate it with steps and attributes.
Begin
- 
                                                        From the Home tab in Application Integrator, click Add Plug-in. 
- 
                                                        On the Add Plug-in pane, complete the following basic plug-in definitions: - 
                                                                In the Plug-in name field, type Azure Data Factory. 
- 
                                                                In the Plug-in ID field, type ADF. 
- 
                                                                From the Steps Default Interface drop-down list, select REST API. 
- 
                                                                In the Description field, type Azure Data Factory REST plugin. 
 
- 
                                                                
- 
                                                        Click Add. The new plug-in opens on a separate tab. It is also added to the list of plug-ins on the Home tab. 
Defining Attributes in the Plug-in
This procedure describes how to prepare Connection Profile attributes and Job Property attributes for use in the plug-in steps.
Begin
- 
                                                        In the plug-in tab of your new plug-in, click Attribute Management. 
- 
                                                        On the Attribute Management pane, under Connection Profile Attributes, define attributes, as follows: - 
                                                                Define a header for the subscription attribute, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- 
                                                                        Define values in the following fields: - From the Field Type drop-down list, select Label.
- In the Label field, type Subscription.
- In the Attribute Name field, type subshead.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the Azure account subscription ID, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type Subscription ID.
- In the Attribute Name field, type Subscription_ID.
 
- 
                                                                        On the Validation tab, toggle on Mandatory field (non empty). 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the authentication method for the connection to Azure (either Service Principal or Managed Identity), as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Label.
- In the Label field, type Identity.
- In the Attribute Name field, type identit.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the Azure Tenant ID, where the Azure Data Factory was created, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type Tenant ID.
- In the Attribute Name field, type tenant_id.
- In the Default Value field, type default.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the ID of the Azure-registered application associated with the service principal, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type Application ID.
- In the Attribute Name field, type app_id.
- In the Default Value field, type default.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the client secret associated with the service principal, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Password.
- In the Label field, type Client Secret.
- In the Attribute Name field, type client_secret.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define a header for several URL attributes, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Label.
- In the Label field, type URL Information.
- In the Attribute Name field, type urlinfo.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the Azure AD authentication endpoint base URL, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type REST Login url.
- In the Attribute Name field, type RESTHost.
- In the Default Value field, type login.microsoftonline.com.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the Azure Management URL, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type Management url.
- In the Attribute Name field, type main_url.
- In the Default Value field, type management.azure.com.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for a timeout for the trigger call made by Control-M to the Azure Data Factory, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type Connection Timeout.
- In the Attribute Name field, type timeout.
- In the Default Value field, type 50.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click Job Properties Attributes and define attributes, as follows: - 
                                                                Define an attribute for the name of the Azure Resource Group that is associated with the relevant data factory, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type Resource Group Name.
- In the Attribute Name field, type ResourceGroupName.
 
- 
                                                                        On the Validation tab, toggle on Mandatory field (non empty). 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the name of the Azure Data Factory that contains the pipeline that you want to run, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type Data Factory Name.
- In the Attribute Name field, type FactoryName.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the name of the pipeline that you want to run, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type Pipeline Name.
- In the Attribute Name field, type PipelineName.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define a header for job parameters, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Label.
- In the Label field, type Parameters: JSON format. Enter {} for no parameters..
- In the Attribute Name field, type parmdetails.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for the JSON-format parameters to pass to the data pipeline at runtime, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text area.
- In the Label field, type Parameters.
- In the Attribute Name field, type Parameters.
 
- 
                                                                        On the Validation tab, toggle on Mandatory field (non empty). 
- 
                                                                        Click Add. 
 
- 
                                                                        
- 
                                                                Define an attribute for an interval (in seconds) between job status checks, as follows: - 
                                                                        Click . The Add Attribute pane appears. 
- Define values in the following fields:- From the Field Type drop-down list, select Text box.
- In the Label field, type Status Polling Frequency.
- In the Attribute Name field, type Poll_Interval.
- In the Default Value field, type 15.
 
- 
                                                                        Click Add. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click Close and then click Save. 
Defining a Pre-Execution Step to Obtain a Token
This procedure describes how to define the pre-execution step, which obtains a token for the connection to Azure Data Factory.
Begin
- 
                                                        From the Azure Data Factory tab, under Execution Steps, select the Pre-execution step and click  . .
- 
                                                        On the Edit Pre-Execution Step pane, in the Description field, type Token for loading pipeline information and click Save. 
- 
                                                        In the REST API tab on the right, complete the following technical details of the pre-execution step: - 
                                                                In the REST API URL field, type https://{{RESTHost}}. 
- 
                                                                In the URL Request Path field, type /{{tenant_id}}/oauth2/token. 
- 
                                                                From the Method drop-down list, select POST. 
- 
                                                                In Headers, in Editor View, type Content-Type=application/x-www-form-urlencoded. 
- 
                                                                In Body, in Editor View, type the following: grant_type=client_credentials&client_id={{app_id}}&client_secret={{client_secret}}&resource=https://management.azure.com/. 
 
- 
                                                                
- 
                                                        In the Output Handling tab, create an output handling rule to save the access token as a runtime parameter, as follows: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
 - 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type access_token. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
 - 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value in Runtime Parameter. 
- 
                                                                        In the Parameter Name field, type TOKEN. 
- 
                                                                        Select the Encrypt the runtime parameter value check box. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click Save. 
Defining an Execution Step to Run a Pipeline
This procedure describes how to define the first Execution step, which runs a Data Factory pipeline.
Begin
- 
                                                        In the plug-in tab, under Execution Steps, select the unnamed Execution step and click  . .
- 
                                                        On the Edit Execution Step pane, type values in the following fields and then click Save: - 
                                                                In the Step Name field, type Run Data Factory Pipeline. 
- 
                                                                In the Description field, type Trigger ADF pipeline. 
 
- 
                                                                
- 
                                                        In the REST API tab on the right, complete the following technical details of the Execution step: - 
                                                                In the REST API URL field, type https://{{main_url}}. 
- 
                                                                In the URL Request Path field, type the following: //subscriptions/{{Subscription_ID}}/resourceGroups/{{ResourceGroupName}}/providers/Microsoft.DataFactory/factories/{{FactoryName}}/pipelines/{{PipelineName}}/createRun?api-version=2018-06-01. 
- 
                                                                From the Method drop-down list, select POST. 
- 
                                                                In Headers, in Editor View, type the following: Content-Type=application/json&Content-Length=0&Authorization=Bearer {{TOKEN}}. 
- 
                                                                In Body, in Editor View, type {{parameters}} 
- 
                                                                Under Advanced Settings, select the Override connection timeout check box and type {{timeout}} in the field. 
 
- 
                                                                
- 
                                                        In the Output Handling tab, create an output handling rule to save the job run ID as a runtime parameter, as follows: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
 - 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type $.runId. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
 - 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value in Runtime Parameter. 
- 
                                                                        In the Parameter Name field, type RUNID. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click Save. 
Defining an Execution Step to Track the Pipeline
This procedure describes how to define the second Execution step, which tracks the running Data Factory pipeline.
Begin
- 
                                                        In the plug-in tab, above the steps, click . 
- 
                                                        On the Add Execution Step pane, complete the following settings and then click Add: - 
                                                                In the Step Name field, type Track the Pipeline. 
- 
                                                                In the Description field, type Track the ADF pipeline. 
- 
                                                                Toggle on the Manual abort operation check box. 
- 
                                                                Toggle on the Verify operation completion check box. 
 
- 
                                                                
- 
                                                        In the REST API tab on the right, complete the following technical details of the Execution step: - 
                                                                In the REST API URL field, type https://{{main_url}}. 
- 
                                                                In the URL Request Path field, type the following: /subscriptions/{{Subscription_ID}}/resourceGroups/{{ResourceGroupName}}/providers/Microsoft.DataFactory/factories/{{FactoryName}}/pipelineruns/{{RUNID}}?api-version=2018-06-01. 
- 
                                                                From the Method drop-down list, select GET. 
- 
                                                                Under the method selection, select the Authentication required check box. 
- 
                                                                Under Authentication Settings, complete the following authentication details: - 
                                                                        From the Authentication Type drop-down list, select OAuth2. 
- 
                                                                        In the OAuth2 API URL field, type https://{{RESTHost}}/{{tenant_id}}/oauth2/token. 
- 
                                                                        In the Token Parameter field, type REFRESHTOKEN. 
- 
                                                                        From the Grant Type drop-down list, select Resource owner password credentials. 
- 
                                                                        Select the Apply client ID check box and type {{app_id}} in the field. 
- 
                                                                        Select the Use client secret check box and type {{client_secret}} in the field. 
- 
                                                                        Select the Specify content type check box and type application/x-www-form-urlencoded in the field. 
- 
                                                                        Select the Apply body check box and, in Editor View, type resource=https://management.azure.com/. 
 
- 
                                                                        
- 
                                                                In Headers, in Editor View, type the following: Content-Type=application/json&Authorization=Bearer {{REFRESHTOKEN}}. 
 
- 
                                                                
- 
                                                        In the Output Handling tab, create an output handling rule to save the activity name from the output, as follows: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
 - 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type value. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
 - 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value of related element. 
- 
                                                                        In the Element Name field, type value[*].activityName. 
- 
                                                                        In the Parameter Name field, type ACTIVITIES. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a second rule to save the start time as a parameter, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type value. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
- 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value of related element. 
- 
                                                                        In the Element Name field, type value[*].activityRunStart. 
- 
                                                                        In the Parameter Name field, type ACTIVITY_RUN_START. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a third rule to save the run ID as a parameter, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type value. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
- 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value of related element. 
- 
                                                                        In the Element Name field, type value[*].activityRunId. 
- 
                                                                        In the Parameter Name field, type ACTIVITY_RUNID. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click Save. 
Defining the Sub-steps of the Second Execution Step
This procedure describes how to define the two sub-steps under the Execution step for tracking the running Data Factory pipeline. One sub-step enables the user to manually abort the job in Control-M and the other sub-step enables Control-M to verify the completion of the job.
Begin
- 
                                                        In the plug-in tab, expand the Execution - Tracking Pipeline Execution step. 
- 
                                                        Select the Manual abort operation sub-step and complete its REST API details, as follows: - 
                                                                In the REST API URL field, type https://{{main_url}}. 
- 
                                                                In the URL Request Path field, type the following: /subscriptions/{{Subscription_ID}}/resourceGroups/{{ResourceGroupName}}/providers/Microsoft.DataFactory/factories/{{FactoryName}}/pipelineruns/{{RUNID}}/cancel?api-version=2018-06-01 
- 
                                                                From the Method drop-down list, select POST. 
- 
                                                                Under the method selection, select the Authentication required check box. 
- 
                                                                Under Authentication Settings, complete the following authentication details: - 
                                                                        From the Authentication Type drop-down list, select Basic. 
- 
                                                                        From the User Name Attribute drop-down list, select CON_PRO. 
- 
                                                                        From the Password Attribute drop-down list, select client_secret. 
 
- 
                                                                        
- 
                                                                In Headers, in Editor View, type the following: Content-Type=application/json&Authorization=Bearer {{REFRESHTOKEN}}. 
- 
                                                                Select the Apend REST API response to job output check box. 
 
- 
                                                                
- 
                                                        Select the Verify operation completion sub-step and click  . .
- 
                                                        On the Edit Verify Operation Completion pane, complete the following settings and then click Save: - 
                                                                In the Rerun Interval (In Seconds) field, type {{Poll_Interval}}. 
- 
                                                                Under Tolerance, toggle on Retry in case of failure and in the Retries field, type 1. 
 
- 
                                                                
- 
                                                        Complete the REST API details of the Verify operation completion sub-step, as follows: - 
                                                                In the REST API URL field, type https://{{main_url}}. 
- 
                                                                In the URL Request Path field, type the following: /subscriptions/{{Subscription_ID}}/resourceGroups/{{ResourceGroupName}}/providers/Microsoft.DataFactory/factories/{{FactoryName}}/pipelineruns/{{RUNID}}?api-version=2018-06-01 
- 
                                                                From the Method drop-down list, select GET. 
- 
                                                                Under the method selection, select the Authentication required check box. 
- 
                                                                Under Authentication Settings, complete the following authentication details: - 
                                                                        From the Authentication Type drop-down list, select OAuth2. 
- 
                                                                        In the OAuth2 API URL field, type https://{{RESTHost}}/{{tenant_id}}/oauth2/token. 
- 
                                                                        In the Token Parameter field, type REFRESHTOKEN. 
- 
                                                                        From the Grant Type drop-down list, select Resource owner password credentials. 
- 
                                                                        Select the Apply client ID check box and type {{app_id}} in the field. 
- 
                                                                        Select the Use client secret check box and type {{client_secret}} in the field. 
- 
                                                                        Select the Specify content type check box and type application/x-www-form-urlencoded in the field. 
- 
                                                                        Select the Apply body check box and, in Editor View, type resource=https://management.azure.com/. 
 
- 
                                                                        
- 
                                                                In Headers, in Editor View, type the following: Content-Type=application/json&Authorization=Bearer {{REFRESHTOKEN}}. 
 
- 
                                                                
- 
                                                        In the Output Handling tab of the Verify operation completion sub-step, create an output handling rule to save the reason for failure if the job fails, as follows: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
 - 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type $.status. 
- 
                                                                        From the drop-down list, select Equals to (=). 
- 
                                                                        In the next field, type Failed. 
 
- 
                                                                        
 - 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value of related element. 
- 
                                                                        In the Element Name field, type $.message. 
- 
                                                                        In the Parameter Name field, type REASON_FOR_FAILURE. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a second rule for failing the job if the pipeline run failed, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type $.status. 
- 
                                                                        From the drop-down list, select Equals to (=). 
- 
                                                                        In the next field, type Failed. 
 
- 
                                                                        
- 
                                                                In the Do action section, from the Do drop-down list, select Complete and fail. 
 
- 
                                                                
- 
                                                        Click to create a third rule for failing the job when canceling a pipeline, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type $.status. 
- 
                                                                        From the drop-down list, select Equals to (=). 
- 
                                                                        In the next field, type Canceling. 
 
- 
                                                                        
- 
                                                                In the Do action section, from the Do drop-down list, select Complete and fail. 
 
- 
                                                                
- 
                                                        Click to create a fourth rule to save the status as a runtime parameter, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type $.status. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
- 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value in Runtime Parameter. 
- 
                                                                        In the Parameter Name field, type RUNSTATUS. 
- 
                                                                        Select the second check box and select Fail in the drop-down list beside it. Then, in the drop-down list after the job if extracted data, select Equals to (=), and type Failed in the last field. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a fifth rule to save runtime parameters, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type $.parameters. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
- 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value in Runtime Parameter. 
- 
                                                                        In the Parameter Name field, type PARAMETERS. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a sixth rule to save the entity that started the pipeline run, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type $.invokedBy. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
- 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value in Runtime Parameter. 
- 
                                                                        In the Parameter Name field, type INVOKEID. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a seventh rule for how to proceed when the pipeline run is successful, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type $.status. 
- 
                                                                        From the drop-down list, select Equals to (=). 
- 
                                                                        In the next field, type Succeeded. 
 
- 
                                                                        
- 
                                                                In the Do action section, from the Do drop-down list, select Complete & Proceed. 
 
- 
                                                                
- 
                                                        Click to create an eighth rule for failing the job when a pipeline is cancelled, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type $.status. 
- 
                                                                        From the drop-down list, select Equals to (=). 
- 
                                                                        In the next field, type Cancelled. 
 
- 
                                                                        
- 
                                                                In the Do action section, from the Do drop-down list, select Complete and fail. 
 
- 
                                                                
- 
                                                        Click Save. 
Defining a Post-Execution Step to Retrieve Pipeline Completion Details
This procedure describes how to define a post-execution step, which retrieves pipeline completion details.
Begin
- 
                                                        In the plug-in tab, under Execution Steps, select the Post-execution step and click  . .
- 
                                                        On the Edit Post-Execution Step pane, in the Description field, type Retrieve pipeline completion details and click Save. 
- 
                                                        In the REST API tab on the right, complete the following technical details of the Execution step: - 
                                                                In the REST API URL field, type https://{{main_url}}. 
- 
                                                                In the URL Request Path field, type the following: /subscriptions/{{Subscription_ID}}/resourceGroups/{{ResourceGroupName}}/providers/Microsoft.DataFactory/factories/{{FactoryName}}/pipelineruns/{{RUNID}}/queryActivityruns?api-version=2018-06-01&startTime="+(Get-Date).ToString('yyyy-MM-dd')+"&endTime="+(Get-Date).AddDays(1).ToString('yyyy-MM-dd')+"&pipelineName={{PipelineName}}". 
- 
                                                                From the Method drop-down list, select POST. 
- 
                                                                In Headers, in Editor View, type the following: Content-Type=application/json&Authorization=Bearer {{REFRESHTOKEN}}. 
- 
                                                                In Body, in Editor View, type the following: {"orderBy":[{"orderBy":"ActivityName","order":"DESC"}],"lastUpdatedBefore":"2040-12-31T23:59:59.999"} 
 
- 
                                                                
- 
                                                        In the Output Handling tab, create an output handling rule to save the activity name from the output, as follows: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
 - 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type value. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
 - 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value of related element. 
- 
                                                                        In the Element Name field, type value[*].activityName. 
- 
                                                                        In the Parameter Name field, type ACTIVITIES. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a second rule to save the start time as a parameter, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type value. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
- 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value of related element. 
- 
                                                                        In the Element Name field, type value[*].activityRunStart. 
- 
                                                                        In the Parameter Name field, type ACTIVITY_RUN_START. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a third rule to save the end time as a parameter, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type value. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
- 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value of related element. 
- 
                                                                        In the Element Name field, type value[*].activityRunEnd. 
- 
                                                                        In the Parameter Name field, type ACTIVITY_RUN_END. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a fourth rule to save the run ID as a parameter, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type value. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
- 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value of related element. 
- 
                                                                        In the Element Name field, type value[*].activityRunId. 
- 
                                                                        In the Parameter Name field, type ACTIVITY_RUNID. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click to create a fifth rule to save execution details, and then perform the following actions: - 
                                                                Define the following filters for output extraction: - From the When the Response Is drop-down list, select Any Response.
- From the Extract from drop-down list, select Body.
- From the Content Type drop-down list, select JSON.
 
- 
                                                                Define the following If condition: - 
                                                                        In the If Output field, type value. 
- 
                                                                        From the drop-down list, select Any. 
 
- 
                                                                        
- 
                                                                Define the following Do action: - 
                                                                        From the Do drop-down list, select Keep value of related element. 
- 
                                                                        In the Element Name field, type value[*].output.executionDetails. 
- 
                                                                        In the Parameter Name field, type EXECUTIONDETAILS. 
 
- 
                                                                        
 
- 
                                                                
- 
                                                        Click Save. 
Testing Your Plug-in
This procedure describes how to run a test execution of the plug-in, to ensure that plug-in jobs can complete successfully.
Begin
- 
                                                        Click Test. Plug-in steps and attributes are first validated. You can continue with the test even if validation issues are found. 
- 
                                                        On the Test tab, select an Agent for the test, and optionally enter values in the Connection Profile fields and Job Properties fields. 
- 
                                                        Click Run Test. The test runs and results are displayed on-screen. 
Publishing and Deploying Your Plug-in
This procedure describes how to publish your plug-in to Control-M/EM and deploy it to an Agent, so that it is available in Control-M.
Begin
- 
                                                        Click Publish & Deploy. Plug-in steps and attributes are first validated. You can continue to publish even if warnings are found. 
- In the Publish & Deploy pane, from the Deploy plug-in to selected agents drop-down list, select the Agents where you want to deploy the plug-in.
- Click Apply.