Migration from PP7 Condition to Planet Press Workflow Metadata

Despite our organization using Planet Press Connect 2020.1, we have still yet to remove all traces of Planet Press 7. In particular we are using a PTK file from PP7, to define conditions based on XPaths.

Our old PP7 file contains several conditions, and these conditions are used to group documents by a ‘type’ attribute, so that we can count the document types.

As the number of letter types is growing, I need a way to move the logic from PP7 into Planet Press Workflow metadata tasks.

The XML source file is structured like
<letterData @type> … …

For example we have a PP7 Condition

Display Name: RR
Planet Press Talk ID: RR
String to Find: RR
Operator: Location
XPath: /letterData[1]/@type

A Planet Press 7 Metadata field called ‘rrconf’ then is conditionally set to a value, for example ‘RR’ when the RR condition is met. It tests each of the conditions and sets it to the appropriate value.

Going forward, we need to convert this to a metadata record in a Document of a Job using Planet Press Workflow, however I’m pretty stuck.

The XML file is already being loaded using a Folder Capture task.

An existing Create Metadata task, loads the legacy PTK file, and evaluates the XML file. (It is this specific step, I’m trying to replace)

There are then a series of task blocks which already test for each of the possible values of ‘rrconf’, to using a Metadata filter, before counting the number of documents which contain the specified value.

To substitute for the Create Metadata task above,

  • I added a Create Metadata task, (passthrough)
  • I added a Metadata Field Management, and then add a field called ‘rrconf’, which is assigned value based on the XML attribute.

For instance, I try to set the value of ‘rrconf’ to ‘RR’ if the conditions is met, but try as a might, I can’t seem to get the notation correct. Is it meant to be something like

xmlget(‘./letterData[?]/@type’,Value,KeepCase,NoTrim) = ‘RR’

There is a many to one relationship between @type values and grouping values.

I haven’t seen any migration documentation for PP7 or Planet Press Workflow Metadata which cover the condition logic migration.

Documentation on the data selection is light. Thoughts?

Hi iwest

I would add a extra JavaScript field to my datamodel with the name of the metadata field you want to use and then code it to extract the appropriate data. in your workflow you could then use a datamapper with metadata selected as the output type. This would then make all the fields including your custom one available for you to use.

However I’d also advise note of caution, in that you appear to be trying to replicate PlanetPress 7 workflows in connect. if you just want your output to be grouped tehn teh grouping and separation options built into the connect job and output presets may give you the output you need with considerably less hassle.

regards

Alex

Based on your specs, here’s how I managed to achieve this:

  • Add a Create Metadata task and set the File name to None (i.e. passthrough mode)
  • Add a Metadata Level Creation task that sets the Document delimiter to Begin when, then click on the ellipsis button to add a rule
  • For the rule, right click on the first operand, select Get data location… and select the first letterData/@type attribute in the file. For the operator, select Does not contain and for the second operand, type something impossible like ~~~~~~~~~. The effect of this rule is therefore to create a new Metadata Document level for each letterData node.
  • Add a Metadata Fields Management task that adds a field named rrconf at the Document level. To set the field value, right click, select Get data location and select again the first letterData/@type attribute in the file.

This should give you the metadata you used to have with the PP7 document.