Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Filter in DataDeploy Config
Bill_Stolp
Hi,
I set up the filter in my DD config file to make a DataDeploy discard the records where some field value (Document_Packet_Id) is equal to zero.
When i try to deploy, it looks like DataDeploy ignores the filter and deploys all records no matter if the value of Document_Packet_Id is equal to zero.
Do someone has any idea what is wrong in my file?
Here how my config looks like:
<data-deploy-configuration>
<filter name="LiquidOffice">
<discard>
<or>
<field name="Document_Packet_id" match="0"/>
</or>
</discard>
</filter>
<data-deploy-elements filepath="F:\Apps\iw-home\opendeployng\OpenDeploy\etc\database.xml" />
<client>
<deployment name="DocMetadata">
<source>
<teamsite-templating-records options="wide" area="$path">
<path filelist="$filelist" visit-directory="deep"/>
</teamsite-templating-records>
</source>
<filter use="LiquidOffice"/>
<destinations>
<database use="$dbname">
<dbschema>
<group name="Document_List_Packet" table="Document_List_Packet" root-group="no">
<attrmap>
<column name="Document_Packet_id" data-type="INTEGER" value-from-field="LOGlobal/0/PacketID" allows-null="no" is-url="no"/>
<column name="Document_Id" data-type="INTEGER" value-from-field="Document/0/DocumentID" allows-null="no" is-url="no"/>
<column name="Question_ID" data-type="INTEGER" value-from-field="LOGlobal/0/Question" allows-null="yes" is-url="no"/>
</attrmap>
<keys>
<primary-key>
<key-column name="Document_Packet_id"/>
</primary-key>
<foreign-key parent-group="Document">
<column-pair parent-column="Document_Id" child-column="Document_Id"/>
</foreign-key>
</keys>
</group>
</dbschema>
</database>
</destinations>
</deployment>
</client>
</data-deploy-configuration>
Thank you
Find more posts tagged with
Comments
Migrateduser
Try using the the key value in the tuple. If you look at the tuple (you can see this in the log) or the value-from-field, LOGlobal/0/PacketID is the key value. So your tuple should have a part that says LOGlobal/0/PacketID=0. So try the following and not the column name. You are filtering the tuples.
<filter name="LiquidOffice">
<discard>
<or>
<field name="LOGlobal/0/PacketID" match="0"/>
</or>
</discard>
</filter>
-Mariam
Bill_Stolp
Thank you!
The filter worked perfectly well now.
However, i have one more thing to solve.
I have added one more group in the config file. I don't want the filter to be applied to this new group, but only to
the first one. Unfortunately, the filter gets applied globally, which means that none of the tuples in the second
group are deployed when the the field from the first group meets the criteria in the filter.
Do you know how i can tell the filter to get applied only to the one group?
Thank you very much!
Migrateduser
You can't specify specific groups to include/exclude for the filter.The only thing I can think of is to specify separate deployments for each group within the same config file, chaining the deployments together with exec-deployment element. Then specify the filter within those deployments for the group that you want filtered. If the tables are independent of one another this may be OK. But if you have tables that are connected, then that will be a problem.
Mariam.