cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble Debugging alfresco jBPM workflows javascript

sanatmastan
Champ in-the-making
Champ in-the-making
Hi,
i have an Advanced workflow in which we have javascript, to debug the workflow javascript i enabled Alfresco javascript debugger, the problem is javascript embedded in  workflow is coming in one line in the alfresco javascript degugger and i am not able to put proper breakpoints,

can anyone please assist me to get workflow javascript in multiple lines in javascript debugger, so that i can put proper breakpoint.

And also can anyone please tell how to add javascript comments in the workflow javascript.

Thanks
Sanat.
4 REPLIES 4

msvoren
Champ in-the-making
Champ in-the-making
add comments like this:
/* comment  */


If you comment with "//", you will comment out  all your code, since it's formating code in 1 line only.

sanatmastan
Champ in-the-making
Champ in-the-making
Thanks verymuch msvoren,

Can anyone please help in debugging javascript  using alfresco javascript degugger

msvoren
Champ in-the-making
Champ in-the-making
You can try this:
Inside transition, where js goes, include js script from the repository (example: my_wf_logic.js). In that script, create a function, and call that from here.
You can pass arguments to function, like attached document to workflow etc. (see example).

Inside my_wf_logic.js, you can write js code as you usually do, you don't have to worry about <,>, &, and comments.
This breaks only because of xml parser when deploying processdefinition.

Example:

<transition name="Go" to="end" >
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
   <runas>admin</runas>
   <script>
      &lt;import resource="/Company Home/Data Dictionary/Scripts/my_wf_logic.js"&gt;
      someFunction(bpm_package.children[0]);
   </script>
      </action>
</transition>

Later on, it easy to debug this using js debugger, or just looking at console logs.

Matija,
Mobitel Business Services

sanatmastan
Champ in-the-making
Champ in-the-making
Thanks for the suggestion msvoren.