9 Replies Latest reply on Jul 19, 2021 12:20 AM by Krishna Gangwar

    Mapping ports result should be output in IDQ Workflow

    Md Ahmed Aziz Guru

      Hi Team,

       

      I have created a mapping and the target is flat file. here my task is get the details from that flat file and send email notification. Can anyone please suggest me how to do, this flat file will actually contains the load job summary of MDM hub console, as MDM doesn't have inbuild function to send load summary as notification. I have taken C_REPOS_JOB_METRIC table as read in IDQ mapping with custom query and loading the result in flat file, so now I want this flat file data to get in notification body in IDQ workflow.

       

      Can anyone please help me out.

       

       

      Thanks,

      Aziz

        • 1. Re: Mapping ports result should be output in IDQ Workflow
          user126898 Guru

          Currently there is no built in way to do so inside of the notification task.  Please see the support KB with the feature request.

           

          Support

           

          From the KB as a workaround.

           

          "

          As a workaround, you can create a custom script. This script can send mail using a utility like Sendmail. Here, you can send attachments as well as logs. Later, the same custom script can be called in a workflow using a command task.

          "

           

          Thanks,

          Scott

          • 2. Re: Mapping ports result should be output in IDQ Workflow
            Md Ahmed Aziz Guru

            Thank to Scott for the response,

             

            Suppose if I don't use flat file and create dummy target, can I get target column result in my output variables?? 

            • 3. Re: Mapping ports result should be output in IDQ Workflow
              user126898 Guru

              Sure that should work.  If you concat the fields you want into a single field and then assign to a mapping variable and then to a workflow variable. you should be able to insert the variable into the notification task in the email body.

               

              Thanks,

              Scott

              1 of 1 people found this helpful
              • 4. Re: Mapping ports result should be output in IDQ Workflow
                Md Ahmed Aziz Guru

                Thank you Scott, for your quick response really appreciated, Let me try this approach.

                • 5. Re: Mapping ports result should be output in IDQ Workflow
                  Md Ahmed Aziz Guru

                  Hi Scott,

                  I added variable at mapping ports, but how do I get this in my workflow notification variable? I just took screenshot of mapping variable, If we go in notification we see system variables by default but how do I get my mapping variables.

                   




                   

                  Thanks,

                  Aziz

                  • 6. Re: Mapping ports result should be output in IDQ Workflow
                    Krishna Gangwar Seasoned Veteran

                    Hi Aziz,

                     

                    From the above screenshot, it looks like you are talking about variable port in a transformation (let's say Expression Tx). Unfortunately, it is not possible to map the transformation level variable port to the workflow variables directly.

                     

                    The only option to pass data from the mapping to a workflow directly is the "Mapping Output" option. However, the mapping output allows only aggregate outputs with the following data types: Integer, Bigint, Date/Time, Decimal and Double.

                     

                    From the above communication, my understanding is that you wish to send the flat-file content in the email notification. With the available Mapping output option, you might not be able to do that. However, there is a quick way to achieve this with the help of the command task.

                     

                    Assuming Informatica services are running on the Linux machine, you can write a simple shell script to send the flat-file content via email.

                     

                    Linux Script: sendEmail.sh

                     

                    #!/bin/sh

                    mail -r sender@domain.com -s 'TEST EMAIL' receiver@domain.com < /tmp/outputFile.txt

                     

                    Now, create a workflow having the mapping task followed by a command task. The command task will have the following content:

                    </Absolute/path/to/script>/sendEmail.sh

                     

                    In the simplest case, your workflow may look like the below:

                     

                    Once you run the workflow, the mapping task will populate the flat file followed by the command task which will invoke the shell script to send an email.

                     

                    It was one of the possible workarounds to achieve your use case quickly and effectively.

                     

                    Let me know if this helps you.

                     

                     

                    regards,

                    Krishna

                    • 7. Re: Mapping ports result should be output in IDQ Workflow
                      Md Ahmed Aziz Guru

                      Hi Krishna,

                       

                      Thank you for elaborating it so nicely and explaining in details, actually variable ports can be avoided, we just need the status of job completion which is in integer value. it will return as 0,1,2,3 etc . suppose I want that mapping port as output in notification, how can I use "Mapping Output" option. do I did to give same name mapping port in "mapping output" and use it as variable ?

                       

                       

                      and we are using Windows server any simple shell script to send the flat-file content via email?

                      • 8. Re: Mapping ports result should be output in IDQ Workflow
                        Krishna Gangwar Seasoned Veteran

                        Hi Aziz,

                         

                        If you simply want the execution status of the mapping task, there is a pre-Defined mapping output "Is Successful" available in the mapping task > output in the mapping task properties in a workflow.

                         

                        However, if you wish to pass a numeric value from the mapping to the workflow, below are the steps:

                         

                        1) Open the mapping and click on an empty area in the mapping editor.

                        2) Navigate to Properties > Outputs

                        3) Click on the new icon and create a port. Select the data type and aggregation type. You can select MIN for this use case.

                        3) After creating the mapping output at the mapping level, select the expression transformation

                        4) Navigate to Properties > Mapping Outputs

                        5) Click New and select the mapping output created in step #3. Provide an expression as needed.

                        Note: You can provide a port name or a static value as well.

                        6) Save the mapping.

                        7) Now, select the mapping task in the workflow and Navigate to Properties > Output and select the mapping output that you created in the mapping.

                        8) Click on the drop-down icon and click "New variable". Provide a name to the workflow variable.

                        9) Now, select the notification task and navigate to Properties > Notification > Email. Click on the "Body" button to use the newly created workflow variable in the email subject/body.

                         

                        Documentation:

                        Mapping Output Expression

                        Binding Mapping Outputs to Workflow Variables

                         

                        Let me know if this helps.

                         

                        regards,

                        Krishna

                        1 of 1 people found this helpful
                        • 9. Re: Mapping ports result should be output in IDQ Workflow
                          Krishna Gangwar Seasoned Veteran

                          Hi Aziz,

                           

                          In addition to my previous response, regarding "shell script to send the flat-file content via email on Windows", looks like you need a third-party app to do so. One such example is Blat. Please take a look at this Stackoverflow post: https://stackoverflow.com/a/9039149/7511632

                           

                          Regards,

                          Krishna

                          1 of 1 people found this helpful