Insert an external library and be able to use it in an HTML <script cam-script type="text/cam-form"> tag

hello everybody :slight_smile: ,

I would like to insert a library in the tasklist scripts. I found this example that shows how to insert a JQuery library.

image

But if I want to use another library, how do I find the parameter to be completed framed here in yellow?

Is this parameter mandatory? or is it not mandatory like the first parameter?

and will inserting a script in this way allow me to use it in a form html tag ?

I would like to use Kendo UI provided by Telerik.

Thanks for your help! Have a nice day :slight_smile:

Hi @LittleDeveloper,

as I tried to explain here, the deps variable name corresponds to the key in the paths object, nothing more.

Those Scripts will be loaded globally, so if they export a global variable, you can use them in a task form.

Hope this makes it clearer

Cheers
Martin

No offense, no I don’t understand sorry, it’s not clear ahah ^^" please excuse me

What do you mean by “the key in the paths object”?

and

I don’t understand this explanation “Those Scripts will be loaded globally, so if they export a global variable, you can use them in a task form.” Does this mean I can use these scripts in the mentioned tag?

Many thanks for your help :slight_smile:

This:

deps: ['myVariableName']

corresponds to the first part of this:

paths: {
  'myVariableName': 'path/unrelated/to/the/name'
}

and not to the content of the file.

They are usally used to load requireJS modules as defined here. As you usually don’t want a requireJS dependency in your embedded forms, you’ll instead want to register the functions you need as window variables by calling window.myFunction inside the script you are loading. You can then use myFunction in the Forms

@martin.stamm
So if I understand well, RequireJS allows to define source script files in a global way. So if these scripts contain variables, these will be accessible in a global way in the process engine. Moreover, the deps parameter allows to point a variable of the script which will become global to the process engine.

Did I understand correctly ?

This is not interesting in the case where we want to use data in a form since we only use them in this form. It is therefore not useful to use this method of script integration in this case.

But if the library we want to integrate contains controllers that we want to use in several forms… is this method interesting?

Thank you for your help and advice ^^