cancel
Showing results for 
Search instead for 
Did you mean: 

How to include ordinary Javascript in processdefinition.xml

nobel
Champ in-the-making
Champ in-the-making
Hi everyone,

   
I have a javascript file called myworkflow.js that contains

function myalffun()
{
     window.alert("something");
return;
}

In my processdefinition.xml i included js as follows:

……
<transition name="approve" to="l10_content_authoring" >
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<import resource="/Company Home/Data Dictionary/Scripts/myworflow.js"/>
<expression>
        myalffun();
</expression>
</script>
</action>
</transition>
…..

The system throws an error as "window" is not defined?

Is there any configuration to be done to use ordinary javascript in processdefintion.xml?

Plz guide me.

Advance Thanks,
nobel
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
It's not an issue of the scripting language.  

You are running your script on a server and there is no "window" object to communicate with.

nobel
Champ in-the-making
Champ in-the-making
Hi mrogers,
    Thanks for your reply,

    Actually i want to create a link through javascript to pop us a jsp page where a user is asked to upload a file while performing workflow process. I am trying this way because i could not include the file browse text box via model.xml
plz guide me how to use javascript there? This will suit my needs.

Thanks in Advance
nobel

mrogers
Star Contributor
Star Contributor
In general you shouldn't attempt to interact with a user in a workflow transition.   

A better solution may be to create a workflow task that has a content property for the user to fill in.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.