Expand my Community achievements bar.

SOLVED

How I can use variables in Adobe OSGI DDX Assembler like we are used in Livecycle ES4 DDX

Avatar

Level 3

We used workflow variables in DDX assembler with Livecycle ES4 JEE. Like this:

<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
  <PDF result = "myPDF">
    <Watermark scale="70%" verticalOffset="-85pt" opacity="100%">
        <PDF source = "docLoteDeclaracoes" pages="{$/process_data/@intPagina$}"/>
    </Watermark>
    <PDF source = "docModeloAnexo"/>
  </PDF>
  <?ddx-source-hint name = "docLoteDeclaracoes"?>
  <?ddx-source-hint name = "docModeloAnexo"?>
</DDX>

In this code workflow process put value of page to be extracted from "docLoteDeclaracoes" in variable intPaginas.

I need to do similar thing using AEM Forms OSGI workflow, but this form to reference variables don't working.

Any one know how reference OSGI workflow variables in DDX document?

OBS: I am using AEM Forms 6.5

1 Accepted Solution

Avatar

Correct answer by
Level 1

This is other solution for this case.

 

  1. Create one file with DDX commands.
<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
  <PDF result = "doc.pdf">
          <PDF source = "docLoteDeclaracoes" pages="1"/>
  </PDF>
  <?ddx-source-hint name = "docLoteDeclaracoes"?>
</DDX>
  1. Set one process variable type XML with file content.

patrick_dec8235_0-1595880003913.png

 

  1. Update command XML Node with xpath for the content.

XPath: //PDF[@source="docLoteDeclaracoes"]/@pages

patrick_dec8235_1-1595880003914.png

 

  1. Invoke DDX

patrick_dec8235_2-1595880003914.png

 

 

View solution in original post

8 Replies

Avatar

Employee Advisor
so you were using execute script in workbench to set the variables values?

Avatar

Level 3
I Think that your are talking about execute operation (x+y) step in workbench. Yes I using this to set "@intPagina" variable with number of page that I need to extract from "docLoteDeclaracoes" PDF. Is possible to do it in OSGI Workflow?

Avatar

Employee Advisor
it's a little different in OSGI world. I will give you a custom OSGI bundle that will allow you to set the value of any xml element or attribute's value

Avatar

Employee Advisor

I have created custom OSGI bundle that allows you to set the value in DDX attribute as part of the workflow as shown in the screen shot

workflowuser_0-1595024346779.png

The first parameter is the location of your DDX file. The second is the element and the third is the attribute , and fourth is the value that needs to be set

After the attribute values are set, the DDX is updated in the original location

You can set multiple attributes as shown in the screenshot

The bundle is shared here.

upload your DDX file into AEM DAM

Deploy the bundle and create a simple workflow with the a process step. Set the process step arguments as shown in the screen shot 

Avatar

Level 3
Thanks @workflowuser. I already solved this putting DDX script into a XML variable and alter properties with a set Variables Step with a Xpath expression (//PDF[@source="docLoteDeclaracoes"]/@pages) to update required property. But I will test your Process Step bundle too.

Avatar

Employee Advisor
nice - I was going that route of using set variable, but for some reason the set variable component was not working on my instance hence the osgi bundle route. But I agree the set variable approach is much easier

Avatar

Correct answer by
Level 1

This is other solution for this case.

 

  1. Create one file with DDX commands.
<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
  <PDF result = "doc.pdf">
          <PDF source = "docLoteDeclaracoes" pages="1"/>
  </PDF>
  <?ddx-source-hint name = "docLoteDeclaracoes"?>
</DDX>
  1. Set one process variable type XML with file content.

patrick_dec8235_0-1595880003913.png

 

  1. Update command XML Node with xpath for the content.

XPath: //PDF[@source="docLoteDeclaracoes"]/@pages

patrick_dec8235_1-1595880003914.png

 

  1. Invoke DDX

patrick_dec8235_2-1595880003914.png