Page 1 of 1

Sharing Common Logic

Posted: Thu Sep 04, 2014 10:29 am
by ChrisHiebert
The user guide has a brief explanation on "Snippets".

Can you expand on this documentation.

Are all snippets required to start with the xml tag "<importfile>"?

Can snippets import other snippets?

Does Director version 4.6.1 allow for promoting of "Snippet" files?

Re: Sharing Common Logic

Posted: Fri Sep 05, 2014 2:39 pm
by Support_Rick
"Snippets" are common code files that can be imported into the current project and used at execution time.

Snippets do require that you provide the <importFile> ... </importFile> as tags.
Snippets cannot import other Snippets (no nested Snippets)

Not sure what you mean by "prompting of snippet files" ... but, you are allowed to pick and choose the snippet you would like to import into your project.

In general terms, the Snippet code allows you to execute a "common" piece of code which can be updated in one location and each Project that calls that snippet would use the changes as they are made to the snippet code.

Import files must be defined PRIOR to executing the Project. For instance, you're not allowed to pass a variable into your project that identifies an Import File then execute.

Re: Sharing Common Logic

Posted: Tue Sep 09, 2014 1:32 pm
by ChrisHiebert
Support_Rick wrote:
Not sure what you mean by "prompting of snippet files" ... but, you are allowed to pick and choose the snippet you would like to import into your project.
I didn't say anything about prompting snippets. I asked about "Promoting" snippets. i.e. Sending Snippets from a Development installation of Goanywhere Director to a Production installation of Goanywhere Director.
ChrisHiebert wrote:
Does Director version 4.6.1 allow for promoting of "Snippet" files?
The answer I've already received from Goanywhere Support was No. You are required to manually "promote" any snippet files created.

Re: Sharing Common Logic

Posted: Tue Sep 09, 2014 2:25 pm
by Support_Rick
My apologies Chris .. I must have mis-read the promoting.

And yes, you would have to manually promote them or place them into a "common" folder that is addressable from both QA/Test and Production if you wanted to share them.