cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to start workflow with no document associated

jzulu2000
Champ in-the-making
Champ in-the-making
I'm trying to start a workflow not from a document, but from an user action.
I added the following configuration in the web-client-config-custom.xml for the user action to appear on the user actions menu:

    <config replace="false">
        <actions>
            <action-group id="browse_actions_menu">
               <action idref="start_workflow"/>
            </action-group>
        </actions>
    </config>


When in a space I try "More Actions"->"Start Advanced Workflow" and after the choosen workflow start task is done, it shows me the following error in console:

10:59:05,578 ERROR [org.alfresco.web.ui.common.Utils] A system error happened during the operation: Mandatory task properties have not been provided: {http://www.alfresco.org/model/bpm/1.0}package
org.alfresco.service.cmr.workflow.WorkflowException: Mandatory task properties have not been provided: {http://www.alfresco.org/model/bpm/1.0}package
   at org.alfresco.repo.workflow.jbpm.JBPMEngine$25.doInJbpm(JBPMEngine.java:1506)
   at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
   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.endTask(JBPMEngine.java:1489)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.endTask(WorkflowServiceImpl.java:444)
   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:281)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
   at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:256)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:191)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
   at $Proxy43.endTask(Unknown Source)
   at org.alfresco.web.bean.workflow.StartWorkflowWizard.finishImpl(StartWorkflowWizard.java:197)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:118)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:115)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:225)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:155)
   at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:124)
   at org.alfresco.web.bean.wizard.WizardManager.finish(WizardManager.java:520)
   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.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834)
   at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)
   at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
   at java.lang.Thread.run(Thread.java:595)

I think it is because alfresco takes the package property from the document who started the workflow, but in this case there's no starter document.

Is there any way to start workflow not from a document? I think workflows may not have documents associated; is this a bug?
10 REPLIES 10

jzulu2000
Champ in-the-making
Champ in-the-making
I think this is an alfresco bug. I've posted a jira: http://issues.alfresco.com/browse/AR-1685

jdbrown
Champ in-the-making
Champ in-the-making
bpmSmiley Tongueackage is configured as mandatory in the bpmModel.xml.  So, workflow does require a document to be assigned.

<association name="bpm:package">
  <source>
              <mandatory>false</mandatory>
              <many>false</many>
  </source>
  <target>
              <class>bpm:workflowPackage</class>
          <mandatory>true</mandatory>
              <many>false</many>
  </target>
</association>

You could still trigger the workflow based on user action, but you would need to assign a document as well.

jzulu2000
Champ in-the-making
Champ in-the-making
Hi jdbrown.
Thanks for you reply.

I think alfresco could create a package with no documents on it, just an empty package; I checked the code and changing 2 lines of code this is possible.
Maybe not all workflows in the world have a document as a starting point.

davidc
Star Contributor
Star Contributor
The workflow package is mandatory, but it can be empty.  The workflow service allows for this.

I checked the code and changing 2 lines of code this is possible.
Maybe not all workflows in the world have a document as a starting point.

Which 2 lines?  Perhaps we can fix.

jzulu2000
Champ in-the-making
Champ in-the-making
Hi Davidc.

I posted a jira with the solution. http://issues.alfresco.com/browse/AR-1685.

The idea is to change the finishImpl method in the org.alfresco.web.bean.workflow.StartWorkflowWizard object to create the workflowPackage even if the this.packageItemsToAdd.size() == 0.

Thanks for you reply.

davidc
Star Contributor
Star Contributor
The fix has been made to the 2.1 enterprise branch.  It will propagate to HEAD soon - I'll let you know.

davidc
Star Contributor
Star Contributor
BTW, thanks for the fix.

risenhoover
Champ in-the-making
Champ in-the-making
Hey guys – I'm having a similar problem trying to kick off a Simple Workflow rule without a document.  My asset is a custom type that descends from cm:content but does not actually have anything in that property – can you advise on how I might work around this?

mrogers
Star Contributor
Star Contributor
The solution is the same as in 2007.    Create an empty package.