Is it possible to use an external javascript library inside of a scripting element?
As an example I'm implementing some logic from a vCAC workflow into a vCO workflow and it would be nice if I could access some of the tools in underscore.js to rewrite this logic. With the rhinojs console I can just run load(filename) to load tools into context, but I couldn't find a similar analog in the docs for vCO. Actions seem to kind of do what I want, but rather than single reusable operations I'd like to do something more analogous to importing a library in java and being able to use it in context.
You could certainly hack something using fileReader / eval but this is not the vCO philosophy. You should build your action library so the content stay in the vCO DB which has several benefits such as checkpointing, vCO nodes clustering, export all your code as a single package with versionable items and so on.
You could certainly hack something using fileReader / eval but this is not the vCO philosophy. You should build your action library so the content stay in the vCO DB which has several benefits such as checkpointing, vCO nodes clustering, export all your code as a single package with versionable items and so on.
Depending on the library I think I can just include the contents of the script / library inside of the action and return it as the return value. Not a string eval, but actually return the object from the action using the action of the container. Thanks!
This is what I typically do.
I recognize this is from years ago. But I'm wondering if anyone can elaborate on this. I'm trying to include the underscore.js library but I'm not quite sure how to do that.