cajitq Absent Member.
Absent Member.
395 views

Workflow displayexpression error when using ScriptVault.JSON

Hi Everyone.

I have a workflow that is being started from at self developed web application. The workflow only has one field where I send a JSON string. In the override function I parse the JSON using ScriptVault.JSON.parse() and build the workflow title based on data in the JSON object. It works sometimes but other times it fail and shows the override script instead of the display expression. The catalina log says "ScriptVault is not defined" so it must be the parse() part that fails.

Sometimes when I refresh the page I can toggle between it working and not working - very strange behaviour.

My best guess is that sometimes the ScriptVault has not yet been initialized or something.

I've only seen this in 4.5.x havent testet it on newer releases.

Does someone know whats going on or how this works????

Kind regards
Carsten
Labels (1)
0 Likes
3 Replies
wschreiber1 Absent Member.
Absent Member.

Re: Workflow displayexpression error when using ScriptVault.JSON

When overriding the workflow name I'd not rely on any script library
being present. Try to restrict yourself to standard ECMAScript functions.

After seeing similar effects like you observed, I assume that library
calls succeed as long as the library is in cache from previous calls.
Otherwise they fail to be evaluated and are displayed as script code.

Wolfgang

On 03.07.2018 12:56, cajitq wrote:
>
> Hi Everyone.
>
> I have a workflow that is being started from at self developed web
> application. The workflow only has one field where I send a JSON string.
> In the override function I parse the JSON using ScriptVault.JSON.parse()
> and build the workflow title based on data in the JSON object. It works
> sometimes but other times it fail and shows the override script instead
> of the display expression. The catalina log says "ScriptVault is not
> defined" so it must be the parse() part that fails.
>
> Sometimes when I refresh the page I can toggle between it working and
> not working - very strange behaviour.
>
> My best guess is that sometimes the ScriptVault has not yet been
> initialized or something.
>
> I've only seen this in 4.5.x havent testet it on newer releases.
>
> Does someone know whats going on or how this works????
>
> Kind regards
> Carsten
>
>

0 Likes
ScorpionSting Absent Member.
Absent Member.

Re: Workflow displayexpression error when using ScriptVault.

What about wrapping it in a $(document).ready(function(){}); ??

Visit my Website for links to Cool Solution articles.
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Workflow displayexpression error when using ScriptVault.JSON

On 7/3/2018 4:56 AM, cajitq wrote:
>
> Hi Everyone.
>
> I have a workflow that is being started from at self developed web
> application. The workflow only has one field where I send a JSON string.
> In the override function I parse the JSON using ScriptVault.JSON.parse()
> and build the workflow title based on data in the JSON object. It works
> sometimes but other times it fail and shows the override script instead
> of the display expression. The catalina log says "ScriptVault is not
> defined" so it must be the parse() part that fails.
>
> Sometimes when I refresh the page I can toggle between it working and
> not working - very strange behaviour.
>
> My best guess is that sometimes the ScriptVault has not yet been
> initialized or something.
>
> I've only seen this in 4.5.x havent testet it on newer releases.
>
> Does someone know whats going on or how this works????
>
> Kind regards
> Carsten
>
>

similar issues made me have 2 fields - one to read with flowdata.get()
inside the name override and another with the JSON. If the name override
is missing I output a default name.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.