cancel
Showing results for 
Search instead for 
Did you mean: 

integration framework attachment replication

mohsen_ali
Explorer
0 Kudos

Dear Team,

Kindly I have a question on integration framework, I made and scenario when create an item master data in database A it will be replicated automatically to database B, and when updating this item master in database A, it will be updated to database B as well,


My question is about attachment, if I put three lines attachment in item master data in database A, in the sender message shows only the first line ID "5" of this attachment only and the two other lines don't show up,

the second problem that, let's suppose the first attachment line in the database A send to database B is "5" then 5 will be replicated to DataBase B but 5 in database B in related to another attachment line in the table ATC1,


so do you have an idea how to replicate all lines of attachment?
and I just want to replicate the exact path and file not the AbsEntry in ATC1 Table.

Regards,
Mohsen

Accepted Solutions (0)

Answers (3)

Answers (3)

HuanYang
Employee
Employee
0 Kudos

Hello Mohsen,

There is a very important thing here. The DI will not upload the file to the target folder.
If you want to use DI for attachment related action. An extra write file/upload file action may be necessary.

For a normal case, you may use the following steps to create a item master data with attachment.

  1. Create the attachment record (221-Add Attachment2)
  2. Read the file
  3. Write the file
  4. create the Item Master Data

For your case, if Database A and Database B are in same server, then the step 2 and step 3 are not necessary.

You may create the attachment with the following code

<Attachments2_Lines>
 <row>
  <SourcePath>C:\TMC</SourcePath>
  <FileName>AC</FileName>
  <FileExtension>jpg</FileExtension>
  <Override>tYES</Override>
 </row>
</Attachments2_Lines>

Thanks & Best regards

Huan Yang

mohsen_ali
Explorer
0 Kudos

Dear Nicolas,

I got the idea but I didn't succeed to make the schema in the transformation atom previous to b1 object atom that will insert the attachment into the receiver system, this is my XSLT i wrote but i don't know what is the problem in it Please help,
<xsl:template name="transform"></xsl:template> <xsl:template name="B1if.object.schema.">
<Attachments2
> <row>
<AbsEntry>
<xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom3']/BOM/BO/OATC/row"></xsl:value-of> </AbsEntry> </row> </Attachments2>
<Attachments2_Lines>
<xsl:for-each select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom3']/BOM/BO/ATC1/row">
<row>
<SourcePath>
<xsl:value-of select="SourcePath"></xsl:value-of>
</SourcePath>
<FileName>
<xsl:value-of select="FileName"></xsl:value-of>
</FileName>
<FileExtension>
<xsl:value-of select="FileExtension"></xsl:value-of>
</FileExtension>
<Override>
<xsl:value-of select="Override"></xsl:value-of> </Override> </row> </xsl:for-each> </Attachments2_Lines>
</xsl:template>

Nicolas_Fuchs
Advisor
Advisor
0 Kudos

Hi Mohsen,

in the Item Master Object you only have the reference to the object stored in "Attachments2". You need to enhance the item master sceanrio with additional data coming from "Attachements2" (Object ID=221) which contain the detailed lines of the reference code. When transfering to another DB this refrence number (=AbsoluteEntry) gets created automatically by the DI-API.

Regards, Nicolas

mohsen_ali
Explorer
0 Kudos

Thanks Nicolas,

But can you help me please with some details for how many atoms will be added, the order of the atoms and configuration and xlst of the attachment because I got the idea but I am a little bit confused?

Regards,
Mohsen