cancel
Showing results for 
Search instead for 
Did you mean: 

dashlets and workflow

molti
Champ in-the-making
Champ in-the-making
Hi. May be someone know, why this code does not work????

My dashlet
ourTasks.get.js

var works = workflow.getCompletedTasks();  

and the error
Failed to execute script 'classpath*:alfresco/site-webscripts/ourTasksDashlet/ourTasks.get.js': 05060005 ReferenceError: "workflow" is not defined.
Why?????
5 REPLIES 5

mikeh
Star Contributor
Star Contributor
Why?????
Because you're on the wrong tier. Workflows are queryable on the Repository tier (/alfresco web app) not the Web tier (/share web app).

Thanks,
Mike

molti
Champ in-the-making
Champ in-the-making
Whether it is correct for share dashlet????

mikeh
Star Contributor
Star Contributor
Whether it is correct for share dashlet????
Please rephrase your question.

Thanks,
Mike

molti
Champ in-the-making
Champ in-the-making
I write dashlet, for Alfresco Share and I use this code
 var works = workflow.getCompletedTasks();
to receive comleted tasks

I put it in d:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\ourTasksDashlet
and if I put it in d:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\site-webscripts\ourTasksDashlet won't be visible in Share

Probably I haven't correctly understood where, it is particularly necessary to put dashlet

mikeh
Star Contributor
Star Contributor
You need to look at how the dashlets that ship with Share work. The Repository tier (/alfresco) contains data webscripts that serve JSON. This JSON is then consumed by the Web tier (/share) to display the dashlet UI.

You can think of Repository = database and Web = UI if that helps.

Thanks,
Mike