Home

CAI Notes 02

Last Updated: 06 January 2025

By: Nataraj Virupaksham (Raj)

Task 1:

Run Taskflow as an API: To Run Taskflow as an API, follow the below steps.

  1. Create a Taskflow with MCT.
  2. Select Start Step, under Allowed users, Give the IICS usernames, only these users can run this Taskflow as an API.
  3. Save and publish as shown in the below screenshot.

What is Publish in IICS?

Before you run a taskflow as an API or schedule a taskflow, you must first publish the taskflow as a service. When you publish a taskflow, Data Integration generates the service (REST) URL and the SOAP service URL. You can use these endpoint URLs to run the taskflow as an API.

When you run a taskflow from the taskflow designer, Data Integration automatically publishes the taskflow, and generates the service (REST) URL and SOAP service URL.

4. Click on the three dots and Select Property detail and Copy the URL as shown in below.

5. The URL looks like below.
https://apse1.dm-ap.informaticacloud.com/active-bpel/rt/Taskflow2-1

6. When you execute this URL in any Browser, Taskflow will automatically run and you can check under the monitor and it will generate Taskflow Run id.

Task 2:
Pass the parameters to the URL: Send an Email:

  1. Create a Taskflow with MCT.
  2. Select Start Step, under Allowed users, Give the IICS usernames, only these users can run this Taskflow as an API.
  3. Go to Start Step, Select Input fields and Create Input field as email.
  4. Drag the Notification Step after MCT, Select Notification Step, Select Details, Then for Email field , Select Email as shown in the below. Give the Emai subject as Test Email.
  5. Save and publish.
  6. Now take the URL and Pass the Email as parameter in the url as shown in the below.
    https://apse1.dm-ap.informaticacloud.com/active-bpel/rt/Taskflow2-1?Email=raj.informatica4@gmail.com
  7. Execute the above URL in any browser and check your inbox, automatically taskflow will trigger and you might get an email as shown in the below.
  8. You can Give n number input fields under start step, and you can use these fields as the parameters in the URL

What is Process in CAI? The Design of API is called a Process.
Services for CAI: To work on CAI, we need the below Services.

  • Application Integration: To create and design the process
  • Application Integration Console: All the processes will monitor
  • Api Manager and API Portal: it is used to Manage the API

Task 3: Create our own API & and Expose the API.
Take an input from user like user_id , and message back the user hello user <username>

  1. Go to Application Integration, and Create a Process as shown in the below.
  2. Give any name like PROC_User.
  3. Go to Start Step , Allow anonymous access , This means Anyone in the internet can use this process. Also Select Run on “Cloud Server” as shown in the below.
  4. I wanted to take userid as input from the user who are executing. you can do the below. Go to Input fields, create a new input field, Give the name as UserID and select Required filed
  5. Output should come as hello user <username> . To achieve this, do the below. Go to output fields, create a new output filed as User_Message as shown in the below.
  6. Assign these input and output fields by using the assignment step.
    Drag the Assignment step, go to Assignments, create a new by clicking + , Select User_message and give the value as shown in the below.
    ‘Hello User: ‘||$input.UserID
  7. Save and publish the process.
  8. Get the URL from proper detail and copy the service (REST) URL
  9. Copy the url as below and pass the input as username. Anyone can execute this URL from anywhere.
    https://apse1-cai.dm-ap.informaticacloud.com/active-bpel/public/rt/cYQkIWovYWOhgzhG2zYBSD/PROC_User?UserID=RajInfa
  10. When you execute the above URL in the browser , you will get an output in json format as like below.
  11. When you execute the above URL in the browser, internally a process will start in IICS, and you can monitor the process under Application Integration console as shown below.

Task 4: Integration of CDI and CAI – Call any Task which created under Data Integration from CAI

The above method can be Implemented by using Service Step.

  1. Go to application Integration and Create new and select Process, Rename the process as
    PROC_INTEGRATE_CDI_CAI
  2. Go to Start Step , Allow anonymous access , This means Anyone in the internet can use this process. Also Select Run on “Cloud Server” as shown in the below.
  3. Go to Input fields, create a new input field, Give the name as UserID and select Required filed
  4. Go to output fields, create a new output filed as User_Message as shown in the below.
  5. Drag the service Step to the process as shown in the below.
  6. Select the service and Select service type as System Service and action as Run cloud Task as shown below.
  7. Go to input fields, Select Task name and select any Task. also check Wait for task to complete. As shown below.
  8. Drag an assignment step to Process and Configure the assignment step as below.
    Under user_message configure as
    ‘Hello User: ‘||$input.UserID
    ||’ Task Status: ‘||$output.TaskStatus
  9. Save and publish.
  10. Get the URL from proper detail and copy the service (REST) URL
    https://apse1-cai.dm-ap.informaticacloud.com/active-bpel/public/rt/cYQkIWovYWOhgzhG2zYBSD/PROC_INTEGRATE_CDI_CAI
  11. Copy the url as below and pass the input as username. Anyone can execute this URL from anywhere.
    https://apse1-cai.dm-ap.informaticacloud.com/active-bpel/public/rt/cYQkIWovYWOhgzhG2zYBSD/PROC_INTEGRATE_CDI_CAI?UserID=RajInfa
    you will get the output Response in the below format.

Task 5:

Call any Task which created under Data Integration from CAI Pass MCT as a Parameter

  1. Go to application Integration and Create new and select Process, Rename the process as PROC_INTEGRATE_CDI_CAI_new
  2. Go to Start Step, allow anonymous access, this means Anyone in the internet can use this process. Also Select Run on “Cloud Server” as shown in the below.
  3. In Start Step, Go to Input fields, create Two input fields with the names, Task_Name and Task_type as like below.
  4. Go to output fields, create a new output filed as User_Message.
  5. Drag the service Step to the process as shown in the below.
  6. Select the service and Select service type as System Service and action as Run cloud Task as shown below.
  7. Select Input and Configure Task as shown in the below.
    $input.Task_Name ||’ [‘||$input.Task_Type ||’]’
  8. Drag an assignment step to Process and Configure the assignment step as below. Under user_message configure as
    ‘This job ‘||$input.Task_Name ||’ Got Succeeded’
  9. Save and publish.
  10. Get the URL from proper detail and copy the service (REST) URL
    https://apse1-cai.dm-ap.informaticacloud.com/active-bpel/public/rt/cYQkIWovYWOhgzhG2zYBSD/Process2
  11. Pass Task_Name & Task_Type parameters and values in the above link.
    https://apse1-cai.dm-ap.informaticacloud.com/active-bpel/public/rt/cYQkIWovYWOhgzhG2zYBSD/Process2?Task_Name=mct_generic_EMP_LOC&Task_Type=MCT
  12. Execute the Above URL in any browser or in postman tool. When you Execute this Process and MCT will be running in IICS and you will get the output in the postman tool as below.
  13. You can pass any Task like Mapping Task , Data Synchronization Task , Data Replication or Mapping task using the below Task types.
    Mapping Task – MCT
    Synchronization Task- DSS
    Replication Task- DRS
    Masking Task- DMASK
    PowerCenter Task -PCS
  14. Pass Data Synchronization Task_Name & Task_Type as DSS parameters and values in the above link or in postman Tool.
    https://apse1-cai.dm-ap.informaticacloud.com/active-bpel/public/rt/cYQkIWovYWOhgzhG2zYBSD/Process2?Task_Name=dss_CONTACTS&Task_Type=DSS

Task 6.

Read the Data from COVID API , And load the data to Table or File Flow: Service Connector -> App Connecttion -> Create Process -> Service  File/DB

What is Service Connector in IICS? Service Connector is used to Connect to third-party services using REST or SOAP APIs.

To Read the data from Covid API, and load the data to table or file, follow the below steps.

  1. Go to application Integration, create new, and Select Service Connectors, and select Service Connector using form.
  2. Rename the Service Connector as, ServiceConnector_ReadCovidData3
  3. Under Service Connector , Under Actions , we have 5 tabs , with the names – Actions, Input, Binding , Output, Test Results .
  4. Go to Actions, create a new action by clicking + symbol and give the action name as GetCovidData (you can use name)
  5. Go input tab and give the input details( will be used input parameters ) which the API is taking As shown on the below. Give the sample values under “Test With”
  6. Go to Binding Tab, Give the API URL (In this case Covid API URL) and select Verb as GET
  7. Go to output and configure the output fields in which we need the values as output from the API.
  8. You can Test the data in service connector by going to “Test Results” tab. And click on Test. You will get the output (response) from API as shown in below.

    Create an App Connection in Application Management Console.
    What us is App Connection in IICS?
    Ans: App Connection is used to create any type of connection in CAI The app connection contains the credentials that the connector uses to perform the action with third-party applications. It used to update metadata of Service connector.
  9. Go to application Management Console , Click on New and Create a New App Connection. Rename as AppConnection-For-SC3. Go to Type, then select and expand the Project as “Raj Informatica Dev” and Open the folder CAI and select your Service Connector “ServiceConnector_ReadCovidData3” As shown in below.

    After selecting it looks like below.
  10. Save and publish the app connection.Create a PROCESS.
  11. Go to application Management Console, Click on New and Create a new Process and Rename as Proc_ReadCovidData3.
  12. Go to Start Step , Allow anonymous access , This means Anyone in the internet can use this process. Also Select Run on “Cloud Server” as shown in the below.To Read the data from API, Use a Service Step
  13. Drag Service Step to Process and select service as app connection which we just created above. Select Service type as Connection and Then select Connection as App Connection, i.e AppConnection-For-SC3 as shown in below.
  14. Select the action as ReadCovidData. You can see the input and output fields which we create under Service Connector as shown in below.
  15. Select Service Step, Go to input fields, click on + and select the input fields shown there and give the static values.
  16. Go to three dots and select Run. It will give message like Successful below.

    Click on the above link, and verify the process whether it is taking correct input or outputs.

    To Write the Data inside the file, we need create one more App Connection.
  17. Go to application Management Console, Click on New and Create a New App Connection. Rename as AppConnection-FILE-WRITER3. Select Type as File and select your local secure agent.
  18. Go to Event Targets Click on “+Add Event Target” and select File Writer.
  19. Rename the File writer as FileWriter3 and Give the file path under Directory filed
  20. Click on Save and Test the connection. Select the Properties and check the Connection is Passed.
  21. Use this File Connection inside the process which we created. To do this, we have to go to Temp fields .
    Go the Process Proc_ReadCovidData3 -> Go to Temp fields ,Add a new filed Temp_File_writer.
    Select the Type ->More Types ->Connection Defined Types
    Select the Connection as AppConnection-FILE-WRITER3 which we created
    Check the option File Writer Task as shown in the below.
  22. We need to Configure the file name and File Content into the object Temp_FileWriter by using Assignment step.
    Drag the Assignment step, go to Assignment Step click on + and select Temp_FileWriter ->File name
    Also Create one more as Temp_FileWriter->Plain File Content as shown in the below.
  23. Configure the file name as below.
    ‘Covid_data_’||$output.date||’.csv’
  24. Configure the Content as below.
    ‘ Date : ‘||$output.date||
    ‘ Active: ‘||$output.active||
    ‘ Confirmed’||$output.confirmed||
    ‘ Recovered’||$output.recovered
  25. To execute the above configuration, we need to create a service Step.
    Drag the Service Step , go to service and select Service type as Connection, Under the Connection, select AppConnection-FILE-WRITER3, Select the Action as FileWriter3
  26. Go to input fields ->select the filewritetask as Temp_File_Writer .
  27. Save and publish. Go to the three dots and Run the Process.
  28. After completion of the above Process, an output file is created under the C:\Program Files\Informatica Cloud Secure Agent\apps\Data_Integration_Server\data\TgtFiles
  29. And the Contend of the File is inside of the file.
  30. The above process explained about Read the data from Covid API and write the data to File.Task 7: Use Decision Step based on the Status code.
  31. Use the Status Code to decide whether, the Process Succeeded or not by doing the below.
    Go to Service Connector ->output -> click on +
    Give the Name as Status_Code, Type as Integer and select the property as HTTP Response Status Code

  32. Save and publish the Process. Also Publish the two app connectors which we have created.
  33. Now The Status_Code output filed is available in the service step under the process which I have shown below.
  34. We are implementing below scenario now.
    If the process is getting succeed and give the status code as 200 , then only we need to the write the data to file otherwise , we should not write the data to the file . This can be achieved by doing the below steps.
  35. Drag a Decision Step after Service step and give Status_Code – Path1 equals 200 as shown in the below.
  36. Save and publish and the Run the Process.

    Task 8: Covid Data to the File. Read the Date and ISO fields from a table and write the particular dates
  37. In the Above Process, we have just passed static Date and ISO to the process and we got the result as one csv file based on the date we have passed to Process.Instead of this we will have some dates and ISO values in table. We will read the data from this table and generate the Covid data of these and dates and ISO which are available from the table.For this I have created a table with the data as shown in below.

    Based on the above Table results, we will Generate one file for each record. So that 7 files will be generated with particular date Covid data.
  38. To the above task, first Take the JDBC Connections from
    Administrator ->Add on Connectors -> Search with JDBC connections and add them.
  39. Create a App Connection to Read the data from Covid_date_input table.
    Go to Application Integration, Create and new AppConnection and rename as AppConnectoin-JDBC5
    Go to Type -> Select JDBC Generic cloud Adapter . Select Run on Secure Agent.
  40. And configure the below JDBC Properties. Search for Oracle JDBC Drivers and save the driver in the system where secure agent is installed.
    JDBC Connection URL — jdbc:oracle:thin:@localhost:1521:xe
    JDBC Jar Directory — C:\JDBC Drivers
    JDBC Driver Class Name – oracle.jdbc.driver.OracleDriver
    Schema : OT_SRC_DEV1
    Username : OT_SRC_DEV1
    Password : admin

    Once you Added the above steps, Go to Administrator ->Runtime Environment -> and Restart the Process server service.
    Test and Publish the AppConnection-JDBC5
  41. We should use the Above AppConnection-JDBC5 inside the Process. To Access the table inside the process, we need to create two temp variables like below.
    Go to Process -> click on Start -> Go to Temp Fields -> Add + and Temp_table
    Select the Type -> More Types -> Connection Defined Types -> AppConnection-JDBC5-> select the table as Covid_date_input and then select allow the list of objects.
  42. Go to Process -> click on Start -> Go to Temp Fields -> Add + and Temp_Row
    Select the Type -> More Types -> Connection Defined Types -> AppConnection-JDBC5-> select the table as Covid_date_input
  43. We have to initialize the above two temp variables by using assignment step. Drag an assignment step before the service step.
    Go to Assignments -> Click on + and select Temp_table ->select Assigned using Query ->and given blank in From.
  44. We need to initialize the Temp_Row by using another Assignment Step.
    Go to Assignments -> Click on + and select Temp_Row -> Assign using Formula ->Go to functions -> and give the function like list:head($temp.Temp_Table).
    List:Head() function is used to read the first record from the table.
    Click on + and select Temp_table -> select Temp_Row -> Assign using Formula ->Go to functions -> and give the function like list:tail($temp.Temp_Table)
    List:Tail() function is used to skip the first row .
  45. Now we should pass the Table fields such as Date and ISO inside the Service step instead of hardcoding.
  46. Go to Service ->input fields -> Date-> Field ->Select Temp_row->report_date Service ->input fields -> Date-> Field ->Select Temp_row->ISO
  47. To read all the records from the table, we need loop this entire process that can be done by the below steps. Create a Decision step after File writer and select Decision and Select temp_table.
  48. If the Decision is not Empty, then Jump back to Second Assignment Step. Take a Jump Step under is not empty path -> and select the second assignment step.
  49. Save and publish. Go to Three Dots and Run the Process. The Entire Process looks like the below.
  50. As we have 7 Records in the Source table, Total 7 output files got generated under the target File directory as shown in the below.

Leave a comment

Subscribe for material notification

Fill this form to get notify when we post new study materials on Raj Informatica.

Post Notification
Back to Top
Product has been added to your cart

Continue Reading CAI Notes 02

Fill out this form to explore all our interview question sets.

Question-Popup

Instructor-Led IT Software Training

Get your dream IT job at top MNCs in just 45 days!

Interested to join? fill this form👇🏻 we'll contact you!

Contact Form