11 Replies Latest reply on Oct 12, 2012 11:26 AM by Viju

    AF 2.0 Delivery endpoint

    rzandvliet

      We want to program our own AF 2.0 delivery endpoint. In the documentation of the Techlabs, of last user conference, there is clear example. This delivery endpoint sends standard content to an .XML file. We want to create a delivery endpoint that sends custom content (Attribute values) to another system. Is this possible with an own created delivery endpoint. I asked this question because I know that there are issues with sending custom content with the “web service” delivery endpoint and I also know that it is possible to send custom content with the “email” delivery endpoint. Can someone give an answer on this question before we start programming it.

        • Re: AF 2.0 Delivery endpoint
          jwong

          The issue with the Web Service Delivery Channel is that the currently released version has a bug where attribute values are not sent correctly. This will be fixed in the next version. It is possible to create a delivery channel to send attribute values.

            • Re: AF 2.0 Delivery endpoint

              Thanks for the important question Robert and thanks for your input, James.

               

              For other readers' benefit, I would like to make sure we all are on the same page with the terminology: the Delivery Endpoint is a "reception entity" that's not necessarily an individual, which makes use of a Delivery Channel to deliver the Notification and its contents. That last part – the Delivery Channel – is what people can develop on their own.

               

              PI Notifications comes with 2 default Delivery Channels: Email and Web Service. We also have a great example on creating a custom Delivery channel: XML. It was first released during the Learning Labs at our last User Conference and it's also available on the vCampus Download Center, as part of the PI Notifications Developer Tools.

               

              As a side note, the next vCampus webinar will be held on January 29th and will cover the AF and Notifications Developer Tools… register now!

                • Re: AF 2.0 Delivery endpoint

                  Steve,

                  Thanks for the further explanation, very useful information for me.  Can we look on Delivery Endpoints in the same vain as plugins in Biztalk?

                  • Re: AF 2.0 Delivery endpoint

                    If you choose to go with the custom Delivery Channel route to meet your requirements, make sure you review the PI Notifications Programmer’s Guide that's posted on the vCampus Library for instructions on this.

                     

                    Basically to get attribute values in the notification, one has to configure the Content Tab on the Notification to include those AF attributes he wants (under Add > Attribute Value) and check them on the Subscription tab. In the code he has to go through the results attribute of the Send method and output each attribute (except for standard content). So for example I followed the instructions from that guide and created a DC with the following code to write to a text file (you would have to figure out how to output to your foreign system):


                    public override void Send(AFNotificationContentResults results)
                    {
                       using( StreamWriter sw = new StreamWriter("C:\\testdc.txt", true))
                       {
                           sw.WriteLine("StartTime: " + results.StartTime);
                           sw.WriteLine("EndTime: " + results.EndTime);
                           for (int j = 0; j < results.Count; j++)
                           {
                               sw.WriteLine(results[j].DisplayName + " " + results[j].Value.Value);
                           
                    }
                           sw.WriteLine("----");
                           sw.Flush();
                          
                    sw.Close();
                       }
                    }

                    Hope this helps!

                      • Re: AF 2.0 Delivery endpoint
                        rzandvliet

                        Steve Pilon

                         

                         

                        sw.WriteLine(results.DisplayName + " " + results.Value.Value);

                         

                        in this way you didn't receive item i from results. I Thnink, this line should be replaced by:

                         

                        sw.WriteLine(results.DisplayName + " " + results.Value.Value);

                          • Re: AF 2.0 Delivery endpoint
                            cescamilla

                            Excuse me robert, but I do not see a correction:

                             

                            steve said:

                             

                            sw.WriteLine(results.DisplayName + " " + results.Value.Value);

                             

                            robert said:

                             

                            sw.WriteLine(results.DisplayName + " " + results.Value.Value);

                             

                             

                             

                            What's the difference?

                              • Re: AF 2.0 Delivery endpoint
                                rzandvliet

                                This is a problem of the forum. It has a strange behaviour with displaying []. Sometimes you have to type the brackets twice. inside of the brackets there must be an i. I think that that was already done in the example, but also not displayed. When I replace the i with an j, there is no problem anymore..... I think, it has to do with some reserved tags.

                                 

                                Below is my "correction"

                                 

                                sw.WriteLine(results[j].DisplayName + " " + results[j].Value.Value);

                                 

                                Regards

                        • Re: AF 2.0 Delivery endpoint
                          rzandvliet

                          JWONG

                          The issue with the Web Service Delivery Channel is that the currently released version has a bug where attribute values are not sent correctly. This will be fixed in the next version. It is possible to create a delivery channel to send attribute values.

                           

                          Thanks for your answer. Do you know when this next version with the fixes is released? When this is in a couple of weeks we can made use of the standard web service delivery channel instead of programming our own delivery channel.