Page 1 of 1

Editing metadata

Posted: Tue Sep 22, 2015 3:14 pm
by LasseThid
I have a flow where I embed an xml file in a pdf using XML Pickup.
At a later stage I would like to change one parameter in the embedded xml data from one value to another. Is that possible? If so, how do I do it?
Thanks

Re: Editing metadata

Posted: Tue Sep 22, 2015 3:31 pm
by gabrielp
I'm not sure about the answer to your question, but I'd also like to know.

But the way I have got around this problem is to not rely on datasets for flow logic in cases where the flow itself might want to change a value (or where the data is not static). In my flows, I'll use XML datasets but once I initially have the dataset, I'll set the values which dictate flow logic to private data. For example, I might take a CSR's email from /aob:manifest/aob:Order/aob:csr_email and set it to Job.PrivateData:Key="CSREmail". Then, maybe later on during the flow, I might have some logic which changes who the email notification goes to or who the CSR is, so I'll send the job into a private data configurator to overwrite PD key CSREmail, allowing me to send the file back into the flow to handle the job like normal, which simplifies the flow a bit.

Re: Editing metadata

Posted: Tue Sep 22, 2015 3:43 pm
by LasseThid
That sounds like it should work for me.

Thanks for the tip.

Edit: Works like a charm. Thanks a bunch Gabriel!

Re: Editing metadata

Posted: Wed Sep 23, 2015 4:30 pm
by sander
Ha, how cool. I was just thinking about how to do this and the only way I could think of is using PrivateData.

So let's look at the forum for some tips, same question asked a day ago, and same thoughts :D

Before I go into using PrivateData, is any of you guys running Switch 13 yet? Can it be done easier with 13?

Re: Editing metadata

Posted: Wed Sep 23, 2015 4:46 pm
by gabrielp
Here's a simple PD script that makes it easy to write values to private data from element properties: https://github.com/dominickp/SwitchWriteToPrivateData

It would be nice, since scripts like these are damn near essential to many workflows, if we all used and improved the same ones over time.

Re: Editing metadata

Posted: Wed Sep 23, 2015 8:44 pm
by sander
I agree.
I have a couple of simple scripts which have been very useful, like you say damn essential. For sure a lot of Switch users have done the same scripting lately, it can't be otherwise.
I'm not a great scripter, but most of my scripts successful passed hundreds/thousands of jobs already haha.

More people interested? Maybe we can start easy and just simple list what we have (by name), to see if there's any more interest.


Edit: forgot to thank you for the PrivateData script, so easy and so extremely useful! Thank you!

Re: Editing metadata

Posted: Thu Sep 24, 2015 7:49 am
by ArielRauch
you are all so lucky - on projects with Scripting module this is the way I handle things also.

I have initiated another thread which tries to accomplish same functionality without Scripting Module capabilities.

Any ideas?

Ariel

Re: Editing metadata

Posted: Thu Sep 24, 2015 10:47 am
by sander
When I started my job (with Switch) a year ago I was not well known with Javascript / Scripting Module.

Since I know other scripting languages I started easy and used Powershell via Execute Command.
You can pass arguments to it, that way we can update/create a XML file and use it in a XML pickup.

Export XML » Powershell pickup / change values » XML pickup.

It takes some time to create, but I guess we need to think in such a way if there's no Scripting Module.

Re: Editing metadata

Posted: Thu Sep 24, 2015 11:18 am
by ArielRauch
Thank you, Sanders.

I think I will try to perl me out of the problem

Re: Editing metadata

Posted: Thu Sep 24, 2015 11:45 am
by LasseThid
I am using Switch 13 on our Developer Server and I'm going to upgrade our Production Server as soon as I see there are no big issues, so far it's only been a couple of minor things due to changes in the configurators.

Perhaps we should ask Enfocus for a Metadata editor?
Since we can embed an xml file via XML Pickup I guess it should be possible to edit the metadata as well.

Re: Editing metadata

Posted: Thu Sep 24, 2015 11:58 am
by sander
Sounds as feature request #1!

I'll ask Enfocus to see if there's anything in the pipeline.

Re: Editing metadata

Posted: Thu Sep 24, 2015 3:43 pm
by gabrielp
LasseThid wrote:Perhaps we should ask Enfocus for a Metadata editor?
Since we can embed an xml file via XML Pickup I guess it should be possible to edit the metadata as well.
I would get behind that as well. Would also be nice if there was a quicker way to inspect metadata of a job, rather than stopping a flow and editing a connector.

Re: Editing metadata

Posted: Thu Sep 24, 2015 4:22 pm
by sander
I don't stop my flows to check metadata.

Right click the jobs column » Show columns » Custom 1/5.
Image

Next right click your column » Set column value » Define condition with variables, and go to your metadata as normal.
Image

It's not the most elegant way, but at least you don't have to stop the flow. I use the custom columns a lot when building flows so I can quickly check what's going on with the metadata.

Re: Editing metadata

Posted: Thu Sep 24, 2015 5:15 pm
by gabrielp
sander wrote:I don't stop my flows to check metadata.

Right click the jobs column » Show columns » Custom 1/5.
Very cool. Did not know you could do that. Thanks for sharing.