Hello,
is it possible to pass an information from the Connect Designer to a PlanetPress Workflow Variable, maybe with the logger.info() function?
In my design template I check if an external dynamic image exists. If it does not exist my section will be skipped and I log an info: logger.info(“Image in record.index does not exist.”). I want to get that info within my automation process to create a report file.
Regards,
Thomas
Sounds like you’re storing the image name and/or path in your data. So at the very least when you run your datamapper, if you tell it to export to XML, you’d have access to the filename in the workflow that you could perform the check again inside the workflow.
Alternatively, if you are checking for the existence of the image within the datamapper itself, you could always output that information into a field, thus avoiding the necessity of checking twice. You’d be able to access it in the same way as above.
Of course, going the datamapper route, you could also simply output that information to a text file via the postprocessor. You can see more on that here: PlanetPress Connect 2018.1 User Guide
I can’t think of a good way to do this during the Create Content step when the template is actually being run, however. You might be able to sort of hack it by having your design template make POST requests back to the workflow…maybe. I have no idea if that could even work. This is just a wild hypothetical here.
I’ve just run a couple tests here on the datamapper option, namely checking if the file exists and writing it into a field.
Works great. This seems like it would be the ideal place for this check as getting the information back out to the workflow is a breeze from here. Either through the metadata or through the post processor.
Here’s all I did. I just commandeered the OpenTextReader function as it returns an error if the file doesn’t exist. If it doesn’t, we just set our variable and move on. If it does exist, we certainly wouldn’t be able to read it like this, but the function doesn’t really care about that. It just opens the file. So we close it up immediately and set our variable.
With this in the data, we no longer need to check existence in the design template itself, we can just check our field instead. So we’re not duplicating disk accesses. It gives us access to the value in the workflow. And it also allows us to make use of the Stop Processing Record functionality in the datamapper so that you don’t even need to finish mapping the rest of that record. It’ll just skip it and no output will ever be generated for it.