cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Frequent Member
Frequent Member

External - Calculations on variables and update

Jump to solution

Hello,

I'm trying to make a Python script, I can get variables from Core and calculate them.

But how to get them updated back to Core? For example I'm passing a number by FFwfdoc.Keywords and how to update it back from Python to Core?

 

Best Regards

Piotr

0 Kudos
6 Replies
Highlighted
Frequent Member
Frequent Member

Re: External - Calculations on variables and update

Jump to solution

Can some answer?

0 Kudos
Highlighted
FreeFlow Production Workflow Moderator
FreeFlow Production Workflow Moderator

Re: External - Calculations on variables and update

Jump to solution

At this moment you cannot update the variable. What you can do however is to create a MAX file on the fly with the variable calculated. As an example the attached script, that you will need to run on a hotfolder, will get the keyword from the pdf as an integer, multiply the keyword by two and create a MAX file that is sent to and picked up by FFCore.

If a pdf named test.pdf is submitted to the hotfolder and if its contains the keyword 123, the resulting MAX file will contain:

C:\Temp\test.pdf;246

You alse need to use the MAX Setup on the hotfolder and set the file to be picked up from column A and the custom variable from column B and select ; as separator. If you set the name of the variable for column B to for instance calculatedkeyword you can then use it as a variable in a workflow by using $FFcalculatedkeyword$

Stefan

 

 

Highlighted
Frequent Member
Frequent Member

Re: External - Calculations on variables and update

Jump to solution

Everything greate but im submitting file by hotfolder passing PDF and I want to change the value of Quantity (for Print node in next step). By default it is set it to 1, I want to change it by calculating in External. Then I can save MAX with calculated quantity by this script?

0 Kudos
Highlighted
FreeFlow Production Workflow Moderator
FreeFlow Production Workflow Moderator

Re: External - Calculations on variables and update

Jump to solution

Using the script I first sent you can add column B as the Standard Field Quantity in the MAX Setup on the hotfolder.

If you wish to do this in an External Process instead you can before printing the job insert Save and an External Process.

wf.png

wf2.PNG

wf3.PNG

Parameters:
"$FFin$" "$FFout$" "$FFxpf$" "$FFwfJob.jobName$" "$FFwfdoc.Keywords$"

The Python script will set "$FFwfdoc.Keywords$" to the number of copies in the XPIF.

Stefan

 

Highlighted
Frequent Member
Frequent Member

Re: External - Calculations on variables and update

Jump to solution

Great this will do the work. Thank You Stefan :)

to set any variable to Print i have to have XPIF or JDF?

0 Kudos
Highlighted
FreeFlow Production Workflow Moderator
FreeFlow Production Workflow Moderator

Re: External - Calculations on variables and update

Jump to solution

You can update the XPIF by using the $FFxpf$ variable. As the job is printed then either XPIF will be used for Xerox printers or it will be converted to JDF for supported non-Xerox printers.