# Data processing ordering and module dependency

**URL:** <https://dmap-community.ductus.global/t/data-processing-ordering-and-module-dependency/314>\
**Category:** Core Engine and APIs\
**Created:** [December 14, 2015, 3:11pm UTC](https://dmap-community.ductus.global/t/data-processing-ordering-and-module-dependency/314 "2015-12-14T15:11:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ichen](https://avatars.discourse-cdn.com/v4/letter/i/b9e5f3/32.png) [@ichen](https://dmap-community.ductus.global/u/ichen)\
**Post date:** [December 14, 2015, 3:11pm UTC](https://dmap-community.ductus.global/t/data-processing-ordering-and-module-dependency/314/1 "2015-12-14T15:11:38Z")

</div>

How do I implement the callpoints for an external database for the YANG modules below so that the message below can be valid? In my experiment, I see that ConfD first performs validation by invoking get\_elem() to find “/citizens/citizen{John}/name”, which is not in the external database, but is being created in the same message.

module test-citizens {  
namespace “[http://www.example.com/yang/test-citizens](http://www.example.com/yang/test-citizens)”;  
prefix “tc”;

organization “”;  
contact “”;

container citizens {  
list citizen {  
key “name”;  
leaf name {  
type string;  
}  
}  
}  
}

module test-dependency {  
namespace “[http://www.example.com/yang/test-dependency](http://www.example.com/yang/test-dependency)”;  
prefix “td”;

import test-citizens {  
prefix “tc”;  
}

organization “”;  
contact “”;

container cities {  
list city {  
key “name”;  
leaf name {  
type string;  
}  
leaf mayor {  
type leafref {  
path “/tc:citizens/tc:citizen/tc:name”;  
}  
}  
}  
}  
}

\<?xml version="1.0" encoding="UTF-8"?\>

td:cities  
\<td:city xc:operation=“create”\>  
td:nameSeattle\</td:name\>  
td:mayorJohn\</td:mayor\>  
\</td:city\>  
\</td:cities\>  
tc:citizens  
\<tc:citizen xc:operation=“create”\>  
tc:nameJohn\</tc:name\>  
\</tc:citizen\>  
\</tc:citizens\>

---

<div class="post-metadata">

**Author:** ![waitai](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/waitai/32/436_2.png) [@waitai](https://dmap-community.ductus.global/u/waitai)\
**Post date:** [December 15, 2015, 7:49pm UTC](https://dmap-community.ductus.global/t/data-processing-ordering-and-module-dependency/314/2 "2015-12-15T19:49:41Z")

</div>

Can you elaborate more on your question? Please explain what do you mean by “the message below can be valid”?

---

<div class="post-metadata">

**Author:** ![ichen](https://avatars.discourse-cdn.com/v4/letter/i/b9e5f3/32.png) [@ichen](https://dmap-community.ductus.global/u/ichen)\
**Post date:** [December 21, 2015, 2:40pm UTC](https://dmap-community.ductus.global/t/data-processing-ordering-and-module-dependency/314/3 "2015-12-21T14:40:47Z")

</div>

I was wondering how ConfD replies to the edit-config message, whether it’s an error or ok.

The YANG modules and the edit-config message didn’t show up well in my initial message, so I’m attaching them with this message.

YANG modules as follows:

```
module test-citizens {
  namespace "http://www.example.com/yang/test-citizens";
  prefix "tc";

  organization "";
  contact "";

  container citizens {
    list citizen {
      key "name";
      leaf name {
        type string;
      }
    }
  }
}

module test-dependency {
  namespace "http://www.example.com/yang/test-dependency";
  prefix "td";

  import test-citizens {
    prefix "tc";
  }

  organization "";
  contact "";

  container cities {
    list city {
      key "name";
      leaf name {
        type string;
      }
      leaf mayor {
        type leafref {
          path "/tc:citizens/tc:citizen/tc:name";
        }
      }
    }
  }
}

```

NETCONF edit-config as follows:

```
<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="104"
     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
     xmlns:tc="http://www.example.com/yang/test-citizens"
     xmlns:td="http://www.example.com/yang/test-dependency">
  <edit-config>
    <target>
      <running />
    </target>
    <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
      <td:cities>
        <td:city xc:operation="create">
          <td:name>Seattle</td:name>
          <td:mayor>John</td:mayor>
        </td:city>
      </td:cities>
      <tc:citizens>
        <tc:citizen xc:operation="create">
          <tc:name>John</tc:name>
        </tc:citizen>
      </tc:citizens>
    </config>
  </edit-config>
</rpc>

```

 ![](https://canada1.discourse-cdn.com/flex010/uploads/ductus_dmap/original/1X/d656e30f47ceec788cc6c2b9946cc1a49590a0c1.PNG)

 ![](https://canada1.discourse-cdn.com/flex010/uploads/ductus_dmap/original/1X/b852b42b703dbaaaf99dc237c3f5b0539cc5dca3.PNG)

---

<div class="post-metadata">

**Author:** ![waitai](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/waitai/32/436_2.png) [@waitai](https://dmap-community.ductus.global/u/waitai)\
**Post date:** [December 21, 2015, 8:08pm UTC](https://dmap-community.ductus.global/t/data-processing-ordering-and-module-dependency/314/4 "2015-12-21T20:08:26Z")

</div>

> [@ichen](#):
>
> I was wondering how ConfD replies to the edit-config message, whether it’s an error or ok.

You get an OK response as follows:

```
21-Dec-2015::12:05:12.350 **> sess:11 read:
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <capabilities>
    <capability>urn:ietf:params:netconf:base:1.0</capability>
  </capabilities>
</hello>

]]>]]>
<rpc xmlns:td="http://www.example.com/yang/test-dependency" xmlns:tc="http://www.example.com/yang/test-citizens" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="104">
  <edit-config>
    <target>
      <running/>
    </target>
    <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
      <td:cities>
        <td:city xc:operation="create">
          <td:name>Seattle</td:name>
          <td:mayor>John</td:mayor>
        </td:city>
      </td:cities>
      <tc:citizens>
        <tc:citizen xc:operation="create">
          <tc:name>John</tc:name>
        </tc:citizen>
      </tc:citizens>
    </config>
  </edit-config>
</rpc>

]]>]]>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <get>
    <filter type="xpath" select=" cities"/>
  </get>
</rpc>

]]>]]>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <get>
    <filter type="xpath" select=" citizens"/>
  </get>
</rpc>

]]>]]>
<rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <close-session/>
</rpc>

21-Dec-2015::12:05:12.387 **< sess:11 write:
<rpc-reply xmlns:tc="http://www.example.com/yang/test-citizens" xmlns:td="http://www.example.com/yang/test-dependency" message-id="104" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <ok/>
</rpc-reply>

21-Dec-2015::12:05:12.400 **< sess:11 write:
<rpc-reply message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <data>
    <cities xmlns="http://www.example.com/yang/test-dependency">
      <city>
        <name>Seattle</name>
        <mayor>John</mayor>
      </city>
    </cities>
  </data>
</rpc-reply>

21-Dec-2015::12:05:12.401 **< sess:11 write:
<rpc-reply message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <data>
    <citizens xmlns="http://www.example.com/yang/test-citizens">
      <citizen>
        <name>John</name>
      </citizen>
    </citizens>
  </data>
</rpc-reply>

21-Dec-2015::12:05:12.401 **< sess:11 write:
<rpc-reply message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <ok/>
</rpc-reply>

**< sess:11 session closed

```

---

<div class="post-metadata">

**Author:** ![ichen](https://avatars.discourse-cdn.com/v4/letter/i/b9e5f3/32.png) [@ichen](https://dmap-community.ductus.global/u/ichen)\
**Post date:** [December 21, 2015, 8:57pm UTC](https://dmap-community.ductus.global/t/data-processing-ordering-and-module-dependency/314/5 "2015-12-21T20:57:47Z")

</div>

Did you try using an external database?

When I used CDB, I get an ok response.

When I used an external database, I get an error.

---

<div class="post-metadata">

**Author:** ![waitai](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/waitai/32/436_2.png) [@waitai](https://dmap-community.ductus.global/u/waitai)\
**Post date:** [December 21, 2015, 9:35pm UTC](https://dmap-community.ductus.global/t/data-processing-ordering-and-module-dependency/314/6 "2015-12-21T21:35:38Z")

</div>

Can you share your data provider code? I can help to debug it.

---

<div class="post-metadata">

**Author:** ![ichen](https://avatars.discourse-cdn.com/v4/letter/i/b9e5f3/32.png) [@ichen](https://dmap-community.ductus.global/u/ichen)\
**Post date:** [January 5, 2016, 9:30pm UTC](https://dmap-community.ductus.global/t/data-processing-ordering-and-module-dependency/314/7 "2016-01-05T21:30:50Z")

</div>

Thanks for your demo. I got it to work now.
