Word document with dynamic image list

Hello everybody
I'm designing a subprocess to generate Word documents with images and be able to reuse it. I have used the DOCX From Dynamic Template component.
I could not pass as the process variable (parameter) the list of images in a dynamic way and with the necessary format (example: = {logo: cons! GFV_IMAGENES})
Dictionary
    logo: List of Document: 2 items
        5765 - queso-lomba.jpg (Document)
        5774 - Queso1.jpg (Document)
How could I send as from the parent process to the subprocess the list of images correctly (dictionary)
Regards
Gustavo

  Discussion posts and replies are publicly visible

Parents
  • Hello everybody

    I have created an Expression Rule that allows to generate a Dynamic Dictionary of images that receives as input the Smart Node DOCX From Dynamic Template


    Now I can use a subprocess to generate the documents, since I can dynamically pass the template, the data and the images

    XML  Input Example:

    "<ListImages><logo>5758</logo><imagen>5765</imagen><imagen>5774</imagen></ListImages>"

    /* Recibe un XML con los IDs de las imagenes y crea el diccionario  para enviarlo al Smart Node DOCX From Dynamic Template

    (Receive an XML with the IDs of the images and create the dictionary
    to send it to the Smart Node DOCX From Dynamic Template)

    Example: <ListImages><icon>5758</icono>
    <image>5765</imagen>
    <image>5774</imagen>
    </ListImages>
    *******/
    if (or(ri!xmlImages = "", isnull( ri!xmlImages )),
       null(),
      load(
                local!xmlImagenes: ri!xmlImages,
               /***** Obtiene el nombre de los nodos del XML(Gets the name of the XML nodes) *****/
              local!nodosXML: union(apply(xpathsnippet(_,"local-name(/*)"),
                                                             xpathsnippet(local!xmlImagenes,"/*/*")),{}),

              /***** Expression *****/
           dictutil_merge(
                                  a!forEach(
                                         items: local!nodosXML,
                                         expression:  dictutil_newbykeyval(fv!item, todocument(xpathsnippet(local!xmlImagenes,"//*[local-name(.)='" & fv!item & "']/text()")

                                       )
                                )
                       )
                  )
            )
    )

    Process Variables

    Input Images:

    Regards, Gustavo

  • Hello , could you share the template please im try to generate like you post ,and i cant generate the doc i need insert only one image. regards

Reply Children
No Data