cancel
Showing results for 
Search instead for 
Did you mean: 

Workflows and pooled actors (groups)

ero
Champ in-the-making
Champ in-the-making
Hi,

Any roadmap regarding group(s) assignment in wokflows?
BPM model seems to be define only for individual users.

Regards,
14 REPLIES 14

davidc
Star Contributor
Star Contributor
It depends on what you mean by group.

The 1.4 community final & next 1.4 enterprise drop support the assignment of multiple people.  For example, you can define a workflow that allows the initiator of the workflow to select one or more people to participate in the workflow e.g. assign multiple reviewers.

The assignment of a pre-defined group is not supported - that'll come post v1.4.

There's a new sample workflow that demonstrates parallel review & approve by multiple people - it's enabled by removing .sample from alfresco/extension/workflow-context.xml.sample. It also demonstrates advanced fork & join workflows.

Some documentation is provided at http://wiki.alfresco.com/wiki/WorkflowAdministration#The_Start_Task.

I notice you use the term pooled actors in the title.  I'd just like to clarify this term.

There is a concept of a pooled task.  A pooled task is one which is allocated to a number of people, of which one of those people will take ownership of the task i.e. assign the task to themselves.  This is useful for supporting work queues.  The pooled actors association of a task represents the collection of people to which the pooled task is allocated.

doc
Champ in-the-making
Champ in-the-making
Hi David,

Thank you for the answers.

What I mean by :
- group: is simply a group of users defined in Alfresco using e.g. Admin Console.
- pooled actors: you explained it very well 🙂 (and it's covered by jBPM if I'm not wrong).

It would be nice to be able to :
1. assign one task to one or more Afresco groups (currently you have to list each individual user of each group) -> pooled actors
2. each user belonging to some group(s) to see and take ownership of some of the tasks assigned to the group(s) he belongs to. It could be done e.g. using a separate dashboard dedicated to tasks assigned to group(s). Assigned tasks should disappear from task list when picked by some user of the group, but not always…e.g. when the task should be managed by (one user of) all groups.

Regards

davidc
Star Contributor
Star Contributor
What's up doc 🙂

Thanks for your feedback.  Although we don't have UI support for Pooled Tasks in v1.4, the back-end support is there.

2. each user belonging to some group(s) to see and take ownership of some of the tasks assigned to the group(s) he belongs to. It could be done e.g. using a separate dashboard dedicated to tasks assigned to group(s). Assigned tasks should disappear from task list when picked by some user of the group, but not always…e.g. when the task should be managed by (one user of) all groups.

Now, this could be implemented fairly easily.  A "My Pooled Tasks" dashlet can be implemented using the "My Tasks" dashlet as a basis.  Instead of calling WorkflowService.getAssignedTasks(), you can call WorkflowService.getPooledTasks().  A simple action to "Take Ownership" can be added to the dashlet.  This action already exists in the Task Dialog.

but not always…e.g. when the task should be managed by (one user of) all groups.

Now, this is tricky.  The reason is that a task currently has one owner.  Perhaps you can expand on your use-case.

1. assign one task to one or more Afresco groups (currently you have to list each individual user of each group) -> pooled actors

Assignment to an Alfresco group is a future enhancement.  But, when we add this, the above dashlet should just continue working.

ero
Champ in-the-making
Champ in-the-making
Hi David,

I haven't foud anywhere the workflow-context.xml.sample.
I searched in bundles and in SVN environment. Nothing.
Any idea where I can find it?

Regarding use case I was thinking about, it's both simple and a little bit complicated.
Sometimes you have to dispatch document to different groups in such a way operational tasks related to that doc can be done in paralell, each assigned operational group managing only some specific infos of that doc (doc content being read only). One member of each assigned group takes task ownership and manages the doc for the group. Doc processing (workflow) is only considered as ended (business point of view) when all assigned groups have finished their respective job.
As for any other task assigned, rejection/task reassignment must also be managed (e.g. doc dispatched to a wrong group).
It should be possible to follow workflow execution both at a group level and at the person level (which group/person is/was in charge of the doc).
Things could become much more complicated if doc content could be modified (managing multiple copies and associations to the initial document, versionning,…).

Best Regards.

rdanner
Champ in-the-making
Champ in-the-making
Hi David,

I haven't foud anywhere the workflow-context.xml.sample.
I searched in bundles and in SVN environment. Nothing.
Any idea where I can find it?

Regarding use case I was thinking about, it's both simple and a little bit complicated.
Sometimes you have to dispatch document to different groups in such a way operational tasks related to that doc can be done in paralell, each assigned operational group managing only some specific infos of that doc (doc content being read only). One member of each assigned group takes task ownership and manages the doc for the group. Doc processing (workflow) is only considered as ended (business point of view) when all assigned groups have finished their respective job.

As for any other task assigned, rejection/task reassignment must also be managed (e.g. doc dispatched to a wrong group).

It should be possible to follow workflow execution both at a group level and at the person level (which group/person is/was in charge of the doc).
Things could become much more complicated if doc content could be modified (managing multiple copies and associations to the initial document, versionning,…).

Best Regards.

Is this a workflow issue or a document organization issue?  If the document has many parts that can be acted on independently or can be processessed in parallel shouldnt you model the document in that way, which would allow it to participate in such a manner? You may not always have the option (a word doc for example) but other content types can be really ganular which enables more parallel workflows (pipelining) and ups the level of re-use

This is something we face at the CS Monitor.  If you ask people on our floor when things happen they generally tell you "All at once".  From a process perspective we have to create the possibility of all at once with the benifits of assembly line concepts.  Having things happen "all at once" provides only a binary state, either it is DONE or it is NOT YET DONE.  If you can break it [the work product]  then the parts have a lifecycle which can be managed independently and that can be measured, aduited and the aggregate be measured in terms of the sum of the progress of the parts.

doc
Champ in-the-making
Champ in-the-making
Hi,

I completely agree with you if you are talking about web content or content you are building and managing yourself, but when it's an external unstructured image document you receive (e.g. scanned document or fax)…it's much more complicated…and that kind of business case is not pure fiction, that's daily document management real life.

rally
Champ in-the-making
Champ in-the-making
It depends on what you mean by group.

The 1.4 community final & next 1.4 enterprise drop support the assignment of multiple people.  For example, you can define a workflow that allows the initiator of the workflow to select one or more people to participate in the workflow e.g. assign multiple reviewers.

The assignment of a pre-defined group is not supported - that'll come post v1.4.

There's a new sample workflow that demonstrates parallel review & approve by multiple people - it's enabled by removing .sample from alfresco/extension/workflow-context.xml.sample. It also demonstrates advanced fork & join workflows.

Some documentation is provided at http://wiki.alfresco.com/wiki/WorkflowAdministration#The_Start_Task.

I notice you use the term pooled actors in the title.  I'd just like to clarify this term.

There is a concept of a pooled task.  A pooled task is one which is allocated to a number of people, of which one of those people will take ownership of the task i.e. assign the task to themselves.  This is useful for supporting work queues.  The pooled actors association of a task represents the collection of people to which the pooled task is allocated.

Hi David,

Can you (or anyone else) provide more information on this?

The 'parallel review & approve by multiple people' is exactly what I'm looking for, but I'm having problems configuring it.

I've put workflow-context.xml in the extensions directory and restarted Tomcat, but I'm not seeing any changes or any new workflows.

Have I configured something incorrectly, or am I missing something?

Any help would be much appreciated as I am demoing this tomorrow and they are looking specifically for this functionality.

Thanks!

aditya
Champ in-the-making
Champ in-the-making
Hi David,

I tried to implement the "My Pooled Tasks" as suggested in this forum.
public List<Node> getGroupTasksToDo()
   {
      // get the current username
      FacesContext context = FacesContext.getCurrentInstance();
      User user = Application.getCurrentUser(context);
      String userName = ISO9075.encode(user.getUserName());
      if (logger.isDebugEnabled())
         logger.debug("Retriving grouptasks for " + userName);
     
      UserTransaction tx = null;
      try
      {
         tx = Repository.getUserTransaction(context, true);
         tx.begin();
        
         // get the current in progress tasks for the current user
           
         List<WorkflowTask> tasks = (List<WorkflowTask>)this.workflowService.getPooledTasks(userName);

         // create a list of transient nodes to represent
         this.groupTasks = new ArrayList<Node>(tasks.size());
         for (WorkflowTask task : tasks)
         {
            Node node = createTask(task);
            this.groupTasks.add(node);
           
            if (logger.isDebugEnabled())
               logger.debug("Added a group task: " + node);
         }
        
         // commit the changes
         tx.commit();
      }
      catch (Throwable e)
      {
         // rollback the transaction
         try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
         Utils.addErrorMessage("Failed to get group tasks: " + e.toString(), e);
      }
     
      return this.groupTasks;
   }

I got the following errors on runtime
17:45:40,240 ERROR [org.alfresco.web.ui.common.Utils] Failed to get group tasks: java.lang.ClassCastException: org.jbpm.taskmgmt.exe.PooledActor
java.lang.ClassCastException: org.jbpm.taskmgmt.exe.PooledActor
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.getTaskProperties(JBPMEngine.java:1247)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.createWorkflowTask(JBPMEngine.java:1818)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$15.doInJbpm(JBPMEngine.java:748)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$15.doInJbpm(JBPMEngine.java:740)
   at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:365)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
   at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
   at org.alfresco.repo.workflow.jbpm.JBPMEngine.getPooledTasks(JBPMEngine.java:738)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.getPooledTasks(WorkflowServiceImpl.java:269)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:32)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:41)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:210)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:156)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:61)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy24.getPooledTasks(Unknown Source)
   at org.alfresco.web.bean.workflow.WorkflowBean.getGroupTasksToDo(WorkflowBean.java:120)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
   at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:71)
   at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
   at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
   at org.apache.commons.el.UnaryOperatorExpression.evaluate(UnaryOperatorExpression.java:156)
   at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:378)
   at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:822)
   at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:436)
   at org.apache.myfaces.renderkit.RendererUtils.renderChildren(RendererUtils.java:427)
   at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:448)
   at org.apache.myfaces.renderkit.RendererUtils.renderChildren(RendererUtils.java:427)
   at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:448)
   at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:203)
   at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:85)
   at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
   at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:349)
   at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:253)
   at org.apache.myfaces.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:55)
   at org.apache.jsp.jsp.dashboards.layouts.single_002dcolumn_jsp._jspService(org.apache.jsp.jsp.dashboards.layouts.single_002dcolumn_jsp:316)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
   at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
   at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
   at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
   at org.apache.jsp.jsp.dashboards.container_jsp._jspService(org.apache.jsp.jsp.dashboards.container_jsp:515)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
   at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
   at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
   at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:86)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)

can you please suggest where i have gone wrong or probably missed out something.

Also I could not find the mentioned "parallel review & approve" example nor did i find "alfresco/extension/workflow-context.xml.sample"

Thanks,
Aditya Malpani.

pascalt
Champ in-the-making
Champ in-the-making
Aditya,
The parallel review process is only included in the enterprise edition.
Haven't found it in the community edition..