cancel
Showing results for 
Search instead for 
Did you mean: 

Listing active workflows

samuel_penn
Champ in-the-making
Champ in-the-making
Hi all,

First off, I've seen http://wiki.alfresco.com/wiki/Workflow_JavaScript_API but I'm using 2.2 so though it looks like what I want, it's not too useful.

What I'd like to be able to do is to get a list of active advanced workflows from Javascript. I thought I might be able to do this by running a search as follows:


search.luceneSearch("TYPE:\"{http://www.alfresco.org/model/bpm/1.0}workflowTask\"");

But though this search runs without error, it returns no results. I've also tried searching for the specific type of tasks (e.g. scwf:engineeringReview) that I know are in the system. Should this sort of search work in 2.2 (in which case, what am I doing wrong?), or am I doomed to failure?

In case I'm completely barking up the wrong tree, what I'm trying to achieve is to provide a way for a user to see where workflows currently are, which users own which steps, and potentially reassign them (in the situation that a user is off sick for example and a manager wants to reassign them). I was hoping to be able to prototype something with a simple Javascript webscript. Is it something that can be done in Java?

Thanks,

Sam.
7 REPLIES 7

birgir
Champ in-the-making
Champ in-the-making
I am looking for similar functionality as you. First off I was hoping a Lucene custom search would do the trick but doesnt seem to fully support workflow based search.

Regarding your query, here's a humble guess. In the lucene XML search definition you have a pairing of types or aspects and properties. There is no property value in your query e.g bpmSmiley Surprisedutcome,bpm:startDate,bpm:taskId etc.

Hope this is of any help

samuel_penn
Champ in-the-making
Champ in-the-making
That might be true, however if I perform a similar search on standard content, then I get back results:


search.luceneSearch("TYPE:\"{http://www.alfresco.org/model/content/1.0}content\"");

I'll give that a try however to see if it makes any real difference (a quick test actually brought back a document (not a workflow) for some reason, possibly it had been in a workflow at some point). I obviously need to do some more investigation.

I've also found this post, which may be one way to do it, however it's not an approach I fancy since it's way too low level:

http://forums.alfresco.com/viewtopic.php?f=34&t=12271&p=40613&hilit=windows+cannot+find+cifs#p41067

birgir
Champ in-the-making
Champ in-the-making
It seems to me that workflows are not stored at all in the Alfresco repository, as far as I know this makes workflow search out of Lucene scope (If anyone can show otherwise please explain). It would be ideal to be able to add workflow types and properties to Lucene config.

However, reading your recuirements are you aware of the "All active tasks" dashlet is out of the box, listing all non completed tasks in the repo and status. Otherwise, querying the workflow tasks can be done using the foundation services in java or more specifically the workflowservice. The workflow console implementation is a good reference. Also the WorkflowBean used for the "pooled tasks" dashlet and "My tasks todo".


http://jsourcery.com/api/sourceforge/alfresco/2.0.0/org/alfresco/web/bean/workflow/WorkflowConsoleBe... (ATN! 2.0.0) 

http://jsourcery.com/api/sourceforge/alfresco/2.0.0/org/alfresco/web/bean/workflow/WorkflowBean.sour...

If anyone knows if or how to use Lucene for workflow based search please enlighten the rest of us.

samuel_penn
Champ in-the-making
Champ in-the-making
However, reading your recuirements are you aware of the "All active tasks" dashlet is out of the box, listing all non completed tasks in the repo and status.

No, I wasn't. Which version of Alfresco is that in, or can it be downloaded from somewhere? It doesn't appear to be listed as an option in my dashboard for 2.2.

Thanks,
Sam.

samuel_penn
Champ in-the-making
Champ in-the-making
Looks like this answers my questions: http://forums.alfresco.com/viewtopic.php?f=34&t=8629

birgir
Champ in-the-making
Champ in-the-making
ok, that settles it then, Lucene does not work.

I know there is a security vulnerability to the "All active task dashlet" (any user could manipulate the tasks), they might have left it out in the default config. I have in webapps\jsp\workflow\tasks-active-dashlet.jsp and in web-client-config.xml

<dashlet id="tasks-active" label-id="tasks_active_title" description-id="tasks_active_desc" jsp="/jsp/workflow/tasks-active-dashlet.jsp" allow-narrow="false" />

User config of dashboards:
http://wiki.alfresco.com/wiki/User_Configurable_Dashboards

samuel_penn
Champ in-the-making
Champ in-the-making
Found it - it was commented out in the web-client-config configuration, which was why I couldn't see it in the front end. It is, as you say, a security hole since anybody can accept/modify a task. It may be a good starting point however if we need to develop our own solution.

Thanks for the help,
Sam.