Pass workflow variable to Output Preset as Separation Count

I want to be able to pass a qty value from the workflow to the output preset to the Separate by Count value in the preset used in the workflow.

image

I’m trying to build a somewhat generic workflow but want to be able to set this value to control the output file separations. I’m trying to get around having to create multiple variations of the same preset but with different split quantities.

Is this possible?

cheers

michael

Hi there,

Would it be possible to update a base output preset in the workflow?

I my case I would just need to update the value in the output preset.

Is this something that anyone has had success with?

image

You could use a script to dynamically change the value in the preset, and then install that modified preset into the Workflow environment.

The following script does just that:

var inputFileName  = "D:/Presets/generic.OL-outputpreset";
var outputFileName = Watch.ExpandString("%t/generic.OL-outputpreset");

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
xmlDoc.load(inputFileName);

var node = xmlDoc.selectSingleNode("/outputCreationConfig/separationConfig/pageCountSplitNo");
node.text="3456";

xmlDoc.save(outputFileName);
Watch.InstallResource(outputFileName)

Note: this script keeps modifying the same “generic.OL-outputpreset” file. So if you have several processes using that same preset, or if your process uses self-replication, then you might run into concurrency issues. It’s important to be aware of this caveat.

1 Like

HI Phil,

Thanks for this method.

It’s probably a little better than the method I tried.

var connectOutputPresetOut = Watch.ExpandString(“%u”)+“.OL-outputpreset”;
Watch.SetVariable(“connectOutputPreset”, connectOutputPresetOut);

var outputPresetIn = fso.OpenTextFile(outputPresetTemplateIn);
var outputPresetOut = fso.CreateTextFile(outputPresetTemplateOut,true);

var tmpLine = "";

while(!outputPresetIn.AtEndOfStream){
    tmpLine = outputPresetIn.Readline();
      if(tmpLine.indexOf("</pageCountSplitNo>") > 0) {
        var newtmpLine = tmpLine.replace(/<pageCountSplitNo>.*<\/pageCountSplitNo>/, "<pageCountSplitNo>" + chunk + "</pageCountSplitNo>")
        outputPresetOut.WriteLine(newtmpLine);
    } else {
        outputPresetOut.WriteLine(tmpLine);
    }
}

    outputPresetIn.Close();
    outputPresetOut.Close();

I had thought of the potential for multiple processes needing to access the preset so used
connectOutputPresetOut = Watch.ExpandString(“%u”)+“.OL-outputpreset”;
to create a unique name to save the preset as.

Then delete of this preset in the workflow once the output creation had run.

I might look at changing over the the method you have suggested as it looks a bit cleaner.

One thing I am trying to work out is how the separations work when imposing a job at the same time.

I was initially trying to separate based on Document Counts as wanted to try and keep full documents together in the separate output files to try an limit confusion in out production processing environment.

But it seems to ignore the separations if they are set to split on a document count and not sheets. I can kind of see why this would be the case but maybe thought I might be missing something.

One other thing I thought too is that I might need to set the stack height values as well when imposing.

How do these work when also separating the output? Do those 2 setting work independent of each other?

cheers

Michael

Sorry to respond with a question, but could you explain a bit more about why you need to split by number of documents? The reason I am asking is because I wonder if there is a way to get you what you need through grouping in a job preset. It might be a bit more involved to set up, but could avoid having to modify a preset on the fly.

Hi @Manuel,

I was wanting to keep whole records together when we create separate pdf files. It’s more for our production environment and so we don’t get records split across files going to our printers.

I’ve had some success separating on sheet counts, it’s just a little tricky for jobs that have variable page counts or page quantities that don’t divide evenly into the separation values that are set in the output presets. I’m thinking we’ll just work with files based on 10,000 sheets separations.

We also need to write corresponding report files for each output pdf, we’ve been doing this with a js script but this also need to know what records are in each output pdf. This is were I’m having a few issues as this reports needs the record counts and First & Last record names from the data for each output file to help reconcile/track files in our production environment.

We’re migrating out of Pres which can write these report files from the PDCs at runtime. So far we haven’t seen that Connect can replicate this functionality.

In Connect we are extracting this info from the run metadata which is where I’m having trouble working out what records are in each file especially for jobs that have varying page counts. Unless there is a way to extract info this from each pdf file after the output preset has run?

I’ve tried looking at the JobCreation presets but the help documentation isn’t really clear as to how the different options work.

Cheers

Michael.

1 Like