1 Reply Latest reply: Nov 23, 2012 3:09 PM by Dan at Branchbird RSS

    Splitting a record using a  Record Manipulator Expression

    951547
      Hi, is there a way to split a record into multiple records? I have read the Data Foundry Expression Ref document but I didn't see any CREATE_RECORD entry. Basically I
      need to split a record for each of the PROD_ID that it has and create a new record of it. I have the ff record :

      <RECORD>
      <PROP NAME="ASSET_ID">
      <PVAL>18638</PVAL>
      </PROP>
      <PROP NAME="ASSET_NAME">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="ASSET_TYPE">
      <PVAL>DATASHEETS</PVAL>
      </PROP>
      <PROP NAME="DS_COPYRIGHT_YEAR">
      <PVAL>2008-08-27 00:00:00</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MODIFIED_BY">
      <PVAL>dmadmin</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MODIFIED_DATE">
      <PVAL>2011-03-19 15:24:59</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_OWNER_NAME">
      <PVAL>dmadmin</PVAL>
      </PROP>
      <PROP NAME="DOCUMENTUM_ID">
      <PVAL>0901b88e800a60fd</PVAL>
      </PROP>
      <PROP NAME="DS_DOCUMENT_ID">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_DCTM_URL">
      <PVAL>/webtop/drl/objectId/0901b88e800a60fd/versionLabel/CURRENT/format/pdf/username/dmguest/ticket/dmguest</PVAL>
      </PROP>
      <PROP NAME="DS_DOCUMENT_TITLE">
      <PVAL>Document Title</PVAL>
      </PROP>
      <PROP NAME="DS_WEB_CANDIDATE">
      <PVAL>T</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_CREATOR_NAME">
      <PVAL>dmadmin</PVAL>
      </PROP>
           <PROP NAME="ASSET_GNRL_CREATION_DATE">
      <PVAL>2011-03-18 15:44:08</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MIME_TYPE">
      <PVAL>application/pdf</PVAL>
      </PROP>
      <PROP NAME="DS_DOC_REV_DATE">
      <PVAL>2008-08-27 00:00:00</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_NAME">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="WEB_CLASSIFICATION_REF">
      <PVAL>HIGH_PERFORMANCE_TRANSISTOR</PVAL>
      </PROP>
      <PROP NAME="Classification_defined">
      <PVAL>HIGH_PERFORMANCE_TRANSISTOR=High Performance Transistor</PVAL>
      </PROP>
           <PROP NAME="PROD_ID">
      <PVAL>PROD_Prod_A</PVAL>
      </PROP>
      <PROP NAME="PROD_ID">
      <PVAL>PROD_Prod_B</PVAL>
      </PROP>
      <PROP NAME="PROD">
      <PVAL>Prod_B</PVAL>
      </PROP>
      <PROP NAME="PROD_defined">
      <PVAL>PROD_Prod_B</PVAL>
      </PROP>
      <PROP NAME="PROD_ID">
      <PVAL>PROD_Prod_C</PVAL>
      </PROP>
      <PROP NAME="PROD">
      <PVAL>Prod_C</PVAL>
      </PROP>
      <PROP NAME="PROD_defined">
      <PVAL>PROD_Prod_C</PVAL>
      </PROP>
      <PROP NAME="PROD_ID">
      <PVAL>PROD_Prod_D</PVAL>
      </PROP>
      <PROP NAME="PROD_ID">
      <PVAL>PROD_Prod_E</PVAL>
      </PROP>
           <PROP NAME="PROD">
      <PVAL>Prod_E</PVAL>
      </PROP>
      <PROP NAME="PROD_defined">
      <PVAL>PROD_Prod_E</PVAL>
      </PROP>
      <PROP NAME="PROD_ID">
      <PVAL>PROD_Prod_F</PVAL>
      </PROP>
      <PROP NAME="PROD">
      <PVAL>Prod_F</PVAL>
      </PROP>
      <PROP NAME="PROD_defined">
      <PVAL>PROD_Prod_F</PVAL>
      </PROP>
      </RECORD>


      and i will be needing to create 6 new records for this so that each PROD_ID has its own record


      <RECORD>
      <PROP NAME="ASSET_ID">
      <PVAL>18638_PROD_Prod_A</PVAL>
      </PROP>
      <PROP NAME="ASSET_NAME">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="ASSET_TYPE">
      <PVAL>DATASHEETS</PVAL>
      </PROP>
      <PROP NAME="DS_COPYRIGHT_YEAR">
      <PVAL>2008-08-27 00:00:00</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MODIFIED_BY">
      <PVAL>dmadmin</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MODIFIED_DATE">
      <PVAL>2011-03-19 15:24:59</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_OWNER_NAME">
      <PVAL>dmadmin</PVAL>
      </PROP>
      <PROP NAME="DOCUMENTUM_ID">
      <PVAL>0901b88e800a60fd</PVAL>
      </PROP>
      <PROP NAME="DS_DOCUMENT_ID">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_DCTM_URL">
      <PVAL>/webtop/drl/objectId/0901b88e800a60fd/versionLabel/CURRENT/format/pdf/username/dmguest/ticket/dmguest</PVAL>
      </PROP>
      <PROP NAME="DS_DOCUMENT_TITLE">
      <PVAL>Document Title</PVAL>
      </PROP>
      <PROP NAME="DS_WEB_CANDIDATE">
      <PVAL>T</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_CREATOR_NAME">
      <PVAL>dmadmin</PVAL>
      </PROP>
           <PROP NAME="ASSET_GNRL_CREATION_DATE">
      <PVAL>2011-03-18 15:44:08</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MIME_TYPE">
      <PVAL>application/pdf</PVAL>
      </PROP>
      <PROP NAME="DS_DOC_REV_DATE">
      <PVAL>2008-08-27 00:00:00</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_NAME">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="WEB_CLASSIFICATION_REF">
      <PVAL>HIGH_PERFORMANCE_TRANSISTOR</PVAL>
      </PROP>
      <PROP NAME="Classification_defined">
      <PVAL>HIGH_PERFORMANCE_TRANSISTOR=High Performance Transistor</PVAL>
      </PROP>
           <PROP NAME="PROD_ID">
      <PVAL>PROD_Prod_A</PVAL>
      </PROP>
      </RECORD>
      <RECORD>
      <PROP NAME="ASSET_ID">
      <PVAL>18638_PROD_Prod_B</PVAL>
      </PROP>
      <PROP NAME="ASSET_NAME">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="ASSET_TYPE">
      <PVAL>DATASHEETS</PVAL>
      </PROP>
      <PROP NAME="DS_COPYRIGHT_YEAR">
      <PVAL>2008-08-27 00:00:00</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MODIFIED_BY">
      <PVAL>dmadmin</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MODIFIED_DATE">
      <PVAL>2011-03-19 15:24:59</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_OWNER_NAME">
      <PVAL>dmadmin</PVAL>
      </PROP>
      <PROP NAME="DOCUMENTUM_ID">
      <PVAL>0901b88e800a60fd</PVAL>
      </PROP>
      <PROP NAME="DS_DOCUMENT_ID">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_DCTM_URL">
      <PVAL>/webtop/drl/objectId/0901b88e800a60fd/versionLabel/CURRENT/format/pdf/username/dmguest/ticket/dmguest</PVAL>
      </PROP>
      <PROP NAME="DS_DOCUMENT_TITLE">
      <PVAL>Document Title</PVAL>
      </PROP>
      <PROP NAME="DS_WEB_CANDIDATE">
      <PVAL>T</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_CREATOR_NAME">
      <PVAL>dmadmin</PVAL>
      </PROP>
           <PROP NAME="ASSET_GNRL_CREATION_DATE">
      <PVAL>2011-03-18 15:44:08</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MIME_TYPE">
      <PVAL>application/pdf</PVAL>
      </PROP>
      <PROP NAME="DS_DOC_REV_DATE">
      <PVAL>2008-08-27 00:00:00</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_NAME">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="WEB_CLASSIFICATION_REF">
      <PVAL>HIGH_PERFORMANCE_TRANSISTOR</PVAL>
      </PROP>
      <PROP NAME="Classification_defined">
      <PVAL>HIGH_PERFORMANCE_TRANSISTOR=High Performance Transistor</PVAL>
      </PROP>
      <PROP NAME="PROD_ID">
      <PVAL>PROD_Prod_B</PVAL>
      </PROP>
      <PROP NAME="PROD">
      <PVAL>Prod_B</PVAL>
      </PROP>
      <PROP NAME="PROD_defined">
      <PVAL>PROD_Prod_B</PVAL>
      </PROP>
      </RECORD>
      ...
      ...
      ...
      <RECORD>
      <PROP NAME="ASSET_ID">
      <PVAL>18638_PROD_Prod_F</PVAL>
      </PROP>
      <PROP NAME="ASSET_NAME">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="ASSET_TYPE">
      <PVAL>DATASHEETS</PVAL>
      </PROP>
      <PROP NAME="DS_COPYRIGHT_YEAR">
      <PVAL>2008-08-27 00:00:00</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MODIFIED_BY">
      <PVAL>dmadmin</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MODIFIED_DATE">
      <PVAL>2011-03-19 15:24:59</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_OWNER_NAME">
      <PVAL>dmadmin</PVAL>
      </PROP>
      <PROP NAME="DOCUMENTUM_ID">
      <PVAL>0901b88e800a60fd</PVAL>
      </PROP>
      <PROP NAME="DS_DOCUMENT_ID">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_DCTM_URL">
      <PVAL>/webtop/drl/objectId/0901b88e800a60fd/versionLabel/CURRENT/format/pdf/username/dmguest/ticket/dmguest</PVAL>
      </PROP>
      <PROP NAME="DS_DOCUMENT_TITLE">
      <PVAL>Document Title</PVAL>
      </PROP>
      <PROP NAME="DS_WEB_CANDIDATE">
      <PVAL>T</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_CREATOR_NAME">
      <PVAL>dmadmin</PVAL>
      </PROP>
           <PROP NAME="ASSET_GNRL_CREATION_DATE">
      <PVAL>2011-03-18 15:44:08</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_MIME_TYPE">
      <PVAL>application/pdf</PVAL>
      </PROP>
      <PROP NAME="DS_DOC_REV_DATE">
      <PVAL>2008-08-27 00:00:00</PVAL>
      </PROP>
      <PROP NAME="ASSET_GNRL_NAME">
      <PVAL>DS300227</PVAL>
      </PROP>
      <PROP NAME="WEB_CLASSIFICATION_REF">
      <PVAL>HIGH_PERFORMANCE_TRANSISTOR</PVAL>
      </PROP>
      <PROP NAME="Classification_defined">
      <PVAL>HIGH_PERFORMANCE_TRANSISTOR=High Performance Transistor</PVAL>
      </PROP>
      <PROP NAME="PROD_ID">
      <PVAL>PROD_Prod_F</PVAL>
      </PROP>
      <PROP NAME="PROD">
      <PVAL>Prod_F</PVAL>
      </PROP>
      <PROP NAME="PROD_defined">
      <PVAL>PROD_Prod_F</PVAL>
      </PROP>
      </RECORD>


      I don't know how to start creating the Record Manipulator Expression to do this. Any ideas will be appreciated. Thanks!
        • 1. Re: Splitting a record using a  Record Manipulator Expression
          Dan at Branchbird
          I think the best way to handle this requirement is to write a custom java manipulator. You can read how to do that here: http://docs.oracle.com/cd/E28911_01/PlatformServices.612/pdf/ContentAdapterGuide.pdf

          In your manipulator's execute() method, you can look through the different prod_id source properties from the input record and instantiate a record for each prod_id encountered (e.g. Record rec1 = handler.getRecord(inp);). You'd then have to delete the other prod_ids and .emit each record in the loop (e.g. handler.emit(rec1);).

          HTH,
          Dan
          http://branchbird.com