Integration Bus - Document not Updating

Robert Tyska asked on March 30, 2018 16:35

I built a connector to handle data coming in from an external system. The data is submit in XML format through a post to an API end point. When that end point gets hit I call ProcessInternalTask() and, in PrepareInternalObject(), I convert the data over to a custom page type.

Everything works fine, to a point. If I turn off "Process Incoming Request" in Settings I see the item in the incoming queue. It is of type "UpdateDocument" and I can see the updated data in the modal, if I click the view button. Then, I run the "Process External Integration Tasks" task and the queue is cleared out, but the object is never updated. No errors are logged anywhere.

From the examples I've seen, I don't think I should be calling treeNode.Update() in PrepareInternalObject(), is that correct? I just assign the IntegrationProcessTypeEnum to UpdateDocument, pull back the treenode in question, update the proper fields and then return it. Is there something I am missing?

Here's the connector code...

public override void Init()
        {
                ConnectorName = GetType().Name;
        }

public override ICMSObject PrepareInternalObject(object obj, TaskTypeEnum taskType, TaskDataTypeEnum dataType, string siteName)
        {
            // Cast to marketingCommunity
            var marketingCommunity = (MarketingCommunity)obj;
            TreeNode treeNode =  DocumentHelper.GetDocuments(marketingCommunity.CurrentClassName).Where("ExternalSourceID = '" + marketingCommunity.Community.CommunityId + "'");

            //  Update fields…
treeNode.SetValue("Zip", marketingCommunity.Community.CommunityZip);
treeNode.SetValue("City", marketingCommunity.Community.CommunityCity);
treeNode.SetValue("State", marketingCommunity.Community.CommunityState);

            return treeNode;
        }

   Please, sign in to be able to submit a new answer.