4 Replies Latest reply: Apr 15, 2014 6:23 AM by Waste Ideas RSS

    not able to add and delete records using partial update

    Waste Ideas

      Hi,

       

      I developed a partial pipeline and executed . There is no error that is generated.But record add and delete is not working, though record update is working fine.

       

      Following is my record manipulator code (jobId is record spec) :

       

      <EXPRESSION LABEL="" NAME="IF" TYPE="VOID" URL="">

       

        <COMMENT>

      - If the record has a "Endeca.Action" field value equal to UPSERT , then use ADD_OR_REPLACE to add or replace the record

      - If the record has a "Endeca.Action" field value equal to DELETE , then use DELETE_OR_IGNORE to delete or ignore the record

      </COMMENT>

        <EXPRESSION LABEL="" NAME="MATH" TYPE="INTEGER" URL="">

          <EXPRNODE NAME="TYPE" VALUE="STRING"/>

          <EXPRNODE NAME="OPERATOR" VALUE="EQUAL"/>

          <EXPRESSION LABEL="" NAME="IDENTITY" TYPE="PROPERTY" URL="">

            <EXPRNODE NAME="PROP_NAME" VALUE="Endeca.Action"/>

          </EXPRESSION>

          <EXPRESSION LABEL="" NAME="CONST" TYPE="STRING" URL="">

            <EXPRNODE NAME="VALUE" VALUE="UPSERT"/>

          </EXPRESSION>

        </EXPRESSION>

       

        <EXPRESSION LABEL="" NAME="UPDATE_RECORD" TYPE="VOID" URL="">

          <EXPRNODE NAME="ACTION" VALUE="UPDATE"/>  

          <EXPRNODE NAME="PROP_ACTION" VALUE="REPLACE"/>

          <EXPRNODE NAME="PROP_NAME" VALUE="jobName"/>

          <EXPRNODE NAME="PROP_ACTION" VALUE="REPLACE"/>

          <EXPRNODE NAME="PROP_NAME" VALUE="jobNotes"/>   

        </EXPRESSION>

       

        <EXPRNODE NAME="ELSE_IF" VALUE=""/>

       

        <EXPRESSION LABEL="" NAME="MATH" TYPE="INTEGER" URL="">

          <EXPRNODE NAME="TYPE" VALUE="STRING"/>

          <EXPRNODE NAME="OPERATOR" VALUE="EQUAL"/>

          <EXPRESSION LABEL="" NAME="IDENTITY" TYPE="PROPERTY" URL="">

            <EXPRNODE NAME="PROP_NAME" VALUE="Endeca.Action"/>

          </EXPRESSION>

          <EXPRESSION LABEL="" NAME="CONST" TYPE="STRING" URL="">

            <EXPRNODE NAME="VALUE" VALUE="DELETE"/>

          </EXPRESSION>

        </EXPRESSION>

       

        <EXPRESSION LABEL="" NAME="UPDATE_RECORD" TYPE="VOID" URL="">

          <EXPRNODE NAME="ACTION" VALUE="DELETE_OR_IGNORE"/>

        </EXPRESSION>

       

        <EXPRNODE NAME="ELSE" VALUE=""/>

       

        <EXPRESSION LABEL="" NAME="UPDATE_RECORD" TYPE="VOID" URL="">

          <EXPRNODE NAME="ACTION" VALUE="ADD_OR_REPLACE"/>

        </EXPRESSION>

       

      </EXPRESSION>

       

      After I run partial udpate after adding a record , get following at <app-name>/data/partials/forge_output/TestAppen-sgmt0.records.xml_2014.03.26.09.33.53

       

      <UPDATE>

         <UPD_UNIT>

            <RECORD_UPDATE>      

               <PROP NAME="jobId">

                  <PVAL>2319</PVAL>

               </PROP>

               <PROP NAME="jobName">

                  <PVAL>ttttt</PVAL>

               </PROP>

               <PVAL_DELETE>

                  <PROPERTY_NAME NAME="jobName"/>

               </PVAL_DELETE>

               <PVAL_ADD>

                  <PROP NAME="jobName">

                     <PVAL>ttttt</PVAL>

                  </PROP>

               </PVAL_ADD>        

                <PVAL_DELETE>

                  <PROPERTY_NAME NAME="jobNotes"/>

               </PVAL_DELETE>       

            </RECORD_UPDATE>

         </UPD_UNIT>

      </UPDATE>

       

       

      As you see , I am getting RECORD_UPDATE not RECORD_ADD

       

      For deletion , I get following in file

       

      <UPDATE>

         <UPD_UNIT>

            <RECORD_DELETE_OR_IGNORE/>

         </UPD_UNIT>

      </UPDATE>

       

      But record doesnt get deleted.

       

      Thanks,

      Mayank Batra

        • 1. Re: not able to add and delete records using partial update
          Waste Ideas

          Is there any update on this?

          • 2. Re: not able to add and delete records using partial update
            Waste Ideas

            just an update : getting following in dgraphA1.update.log file while trying to add new record using partial


            ERROR 03/28/14 10:51:56.678 UTC (1396003916678) DGRAPH {dgraph,update} Record update: <record_update> <prop name="jobId"><pval>2325</pval></prop> <prop name="jobName"><pval>AZAZAZAZ</pval></prop> <pval_delete><property_name name="jobName"/></pval_delete> <pval_add> <prop name="jobName"><pval>AZAZAZAZ</pval></prop> </pval_add> <pval_delete><property_name name="jobNotes"/></pval_delete> </record_update> : Record does not exist. Ignoring record update. [recspec=`jobId:2325']

            • 3. Re: not able to add and delete records using partial update
              Waste Ideas

              Does anybody have code snippet or record manipulator in partial update where input for the pipeline comes from CAS?

              • 4. Re: not able to add and delete records using partial update
                Waste Ideas

                Record add and update are working fine
                Some more input : Getting no logs while running partial for adding (and i believe it will stay the same for updation) but getting below logs at /logs/forges/PartialForge/PartialForge.log on deletion :

                WARN 04/14/14 13:13:49.401 UTC (1397481229401) FORGE {update}: The RecordManipulator 'checkUpdateDelete' has an index that produced a null record key. Please ensure that the record index is correct. This message will be suppressed but the number of records with null keys will be printed when the application finishes.
                WARN 04/14/14 13:13:51.755 UTC (1397481231755) FORGE {update}: The RecordManipulator 'checkUpdateDelete' returned 1 records with null keys.
                WARN 04/14/14 13:13:51.756 UTC (1397481231756) FORGE {update}: Forge completed with 0 errors and 2 warnings.

                We are stuck for some time now. really appreciate your help.

                Thanks,
                Mayank Batra