Persisting data of a single entity type

Use task definition ID 90 if you are persisting data that is all of a single entity_type.

Example of the Persist Entities (single entity type) task (CSV file)

As shown in the code that follows, you can choose not to specify the entity_type for all records in a CSV file. Instead, you can specify entity_type within the task definition comment by setting the value of the VariableParameter tag. For example, this code pulls in person entities.

The following code is drawn from the predefined batch job PersistEntity_csv2.xml. Predefined batch job templates are available in the folder $home/templates/jobs (where $home represents the directory where the batch processor is installed).

<?xml version="1.0" encoding="UTF-8"?>
<TCRMService xmlns="http://www.ibm.com/mdm/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/mdm/schema MDMDomains.xsd">
  <RequestControl>
    <requestID>1</requestID>
    <DWLControl>
      <requesterName><<requesterName>></requesterName>
      <requesterLocale>en</requesterLocale>
      <requesterTimeZone><<requesterTimeZone>></requesterTimeZone>
    </DWLControl>
  </RequestControl>
  <TCRMTx>
    <TCRMTxType>addTask</TCRMTxType>
    <TCRMTxObject>TaskBObj</TCRMTxObject>
    <TCRMObject>
      <TaskBObj>
        <TaskDefinitionId>90</TaskDefinitionId>
        <TaskCatType>8</TaskCatType>
        <PriorityType><<PriorityType>></PriorityType>
        <TaskOwnerRole>Bulk Processing</TaskOwnerRole>
        <TaskDueDate><<TaskDueDate>></TaskDueDate>
        <ProcessId><<ProcessId>></ProcessId>
        <TaskActionType>1</TaskActionType>
        <TaskCommentBObj>
          <!-- The following definition comment is provided as a sample.
               It should be adjusted to fit the requirements -->
          <!-- 
            Note: 
              1. Persist all person entities provided in the input file
              2. Task definition 90 requires only ENTITY_ID in the input file / db query and ENTITY_TYPE is 
                  passed in as variable parameter. The CSV input file PersistEntityInput_CSV2.txt 
                  contains only ENTITY_ID of person entities.
          -->
          <CommentText>
            <![CDATA[
            <VariableParameter>ENTITY_TYPE=mdmper</VariableParameter>
            <File>PersistEntityInput_CSV2.txt</File>
            ]]>
          </CommentText>
        </TaskCommentBObj>
        <TaskCommentBObj>
          <CommentText>
            <![CDATA[
            <BatchInstance><<BatchInstance>></BatchInstance>
            ]]>
          </CommentText>
        </TaskCommentBObj>
        <WorkbasketBObj>
          <Name><<Name>></Name>
        </WorkbasketBObj>
      </TaskBObj>
    </TCRMObject>
  </TCRMTx>
</TCRMService>

Example of the Link or Persist Entity (single entity type) task (SQL)

As shown in the code that follows, you can choose not to specify the entity_type for all records in a SQL statement. Instead, you can specify entity_type within the task definition comment by setting the value of the VariableParameter tag. For example, this code pulls in organization entities.

The following code is drawn from the predefined batch job PersistEntity_db1.xml. Predefined batch job templates are available in the folder $home/templates/jobs (where $home represents the directory where the batch processor is installed).

<?xml version="1.0" encoding="UTF-8"?>
<TCRMService xmlns="http://www.ibm.com/mdm/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/mdm/schema MDMDomains.xsd">
  <RequestControl>
    <requestID>1</requestID>
    <DWLControl>
      <requesterName><<requesterName>></requesterName>
      <requesterLocale>en</requesterLocale>
      <requesterTimeZone><<requesterTimeZone>></requesterTimeZone>
    </DWLControl>
  </RequestControl>
  <TCRMTx>
    <TCRMTxType>addTask</TCRMTxType>
    <TCRMTxObject>TaskBObj</TCRMTxObject>
    <TCRMObject>
      <TaskBObj>
        <TaskDefinitionId>90</TaskDefinitionId>
        <TaskCatType>8</TaskCatType>
        <PriorityType><<PriorityType>></PriorityType>
        <TaskOwnerRole>Bulk Processing</TaskOwnerRole>
        <TaskDueDate><<TaskDueDate>></TaskDueDate>
        <ProcessId><<ProcessId>></ProcessId>
        <TaskActionType>1</TaskActionType>
        <TaskCommentBObj>
          <!-- The definition comment provided below is a sample, it should be adjusted to fit the requirements -->
          <!-- 
            Note: 
              1. Persist all organizations that have not been persisted 
              2. Task definition 90 requires only ENTITY_ID in the input file / db query and ENTITY_TYPE is 
                  passed in as variable parameter
          -->
          <CommentText>
            <![CDATA[
            <SQLOverride>SELECT DISTINCT CURENTRECNO AS ENTITY_ID FROM MPI_ENTLINK_MDMORG WHERE CURENTRECNO NOT IN (SELECT ENTITY_ID FROM CONTACT WHERE PERSON_ORG_CODE = 'O' AND ENTITYLINK_ST_TP_CD = 2)</SQLOverride>
            <VariableParameter>ENTITY_TYPE=mdmorg</VariableParameter>
            ]]>
          </CommentText>
        </TaskCommentBObj>
        <TaskCommentBObj>
          <CommentText>
            <![CDATA[
            <BatchInstance><<BatchInstance>></BatchInstance>
            ]]>
          </CommentText>
        </TaskCommentBObj>
        <WorkbasketBObj>
          <Name><<Name>></Name>
        </WorkbasketBObj>
      </TaskBObj>
    </TCRMObject>
  </TCRMTx>
</TCRMService>