Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Unprioritized Unprioritized
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0.2
    • Component/s: Workflow
    • Labels:
      None

      Description

      Steps to recreate:

      1. Start an ad hoc workflow on a document and assign it to someone.
      2. Log in as that someone and complete the task.
      3. Use the Explorer Workflow Console to "show workflows all" to grab the workflow ID and save it off somewhere.
      4. Log in as the person who started the workflow and complete the notification task. This ends the workflow.
      5. If you log in to the Explorer workflow console and do a "show workflows all" the workflow will not appear.
      6. Via the workflow service, you can still grab a handle to the workflow:

      wf = workflow.getInstance("activiti$101");
      if (wf == null)

      { print("is null"); }

      else

      { print("Active:" + wf.isActive()); print("Id:" + wf.getId()); print("Desc:" + wf.getDescription()); }

      7. If you now try to delete the workflow (and note you have to use this syntax to work around the reserved word problem), you'll get an error:

      wf['delete']();

      Here is the relevant stack trace:

      Caused by: org.alfresco.service.cmr.workflow.WorkflowException: 01280364 Failed to delete unexisting workflow instance

      {0}

      .
      at org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine.deleteWorkflow(ActivitiWorkflowEngine.java:271)
      at org.alfresco.repo.workflow.WorkflowServiceImpl.deleteWorkflow(WorkflowServiceImpl.java:575)
      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:597)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:147)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      at $Proxy71.deleteWorkflow(Unknown Source)
      at org.alfresco.repo.workflow.jscript.JscriptWorkflowInstance.delete(JscriptWorkflowInstance.java:191)
      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:597)
      at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
      at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
      at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3237)
      at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2394)
      at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
      at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2234)
      at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:257)
      at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:127)
      at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3237)
      at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2394)
      at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
      at org.mozilla.javascript.ScriptRuntime.evalSpecial(ScriptRuntime.java:2280)
      at org.mozilla.javascript.ScriptRuntime.callSpecial(ScriptRuntime.java:2143)
      at org.mozilla.javascript.optimizer.OptRuntime.callSpecial(OptRuntime.java:165)
      at org.mozilla.javascript.gen.c22._c0(jar:file:/opt/apache/tomcat/apache-tomcat-6.0.32/shared/lib/javascript-console.jar!/alfresco/templates/webscripts/de/fme/jsconsole/execute.post.js:256)
      at org.mozilla.javascript.gen.c22.call(jar:file:/opt/apache/tomcat/apache-tomcat-6.0.32/shared/lib/javascript-console.jar!/alfresco/templates/webscripts/de/fme/jsconsole/execute.post.js)
      at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
      at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
      at org.mozilla.javascript.gen.c22.call(jar:file:/opt/apache/tomcat/apache-tomcat-6.0.32/shared/lib/javascript-console.jar!/alfresco/templates/webscripts/de/fme/jsconsole/execute.post.js)
      at org.mozilla.javascript.gen.c22.exec(jar:file:/opt/apache/tomcat/apache-tomcat-6.0.32/shared/lib/javascript-console.jar!/alfresco/templates/webscripts/de/fme/jsconsole/execute.post.js)
      at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:483)
      at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:191)

        Activity

        Hide
        Jeff Potts added a comment -

        Confirmed that this is also the case on Alfresco Enterprise 4.0.0.

        Show
        Jeff Potts added a comment - Confirmed that this is also the case on Alfresco Enterprise 4.0.0.
        Hide
        Frederik Heremans added a comment -

        The Explorer workflow-console is a 1-to-1 mapping of the Workflow API. The method called when using "delete activiti$12345" is "public WorkflowInstance deleteWorkflow(String workflowId);" on org.alfresco.repo.workflow.WorkflowComponent. At the time of implementing, the goal was to comply with the existing API and behavior.

        Javadoc for this method states: " Delete an "in-flight" Workflow instance" -> We interpreted a completed workflow as being "no longer in flight". To be concrete, a process "delete" call on a running process is the same as "canceling" a process, only the state "cancelled" and "deleted" in the end-process-listeners are different.

        Calling delete on a completed workflow indeed doesn't work. This can be implemented, but there should be clarity about the javadoc's stating "in flight" instances.

        Show
        Frederik Heremans added a comment - The Explorer workflow-console is a 1-to-1 mapping of the Workflow API. The method called when using "delete activiti$12345" is "public WorkflowInstance deleteWorkflow(String workflowId);" on org.alfresco.repo.workflow.WorkflowComponent. At the time of implementing, the goal was to comply with the existing API and behavior. Javadoc for this method states: " Delete an "in-flight" Workflow instance" -> We interpreted a completed workflow as being "no longer in flight". To be concrete, a process "delete" call on a running process is the same as "canceling" a process, only the state "cancelled" and "deleted" in the end-process-listeners are different. Calling delete on a completed workflow indeed doesn't work. This can be implemented, but there should be clarity about the javadoc's stating "in flight" instances.
        Hide
        Frederik Heremans added a comment -

        Deleting completed workflow is now possible due to fix for ALF-13474 (checked in on HEAD and will be available in next 4.0.X release)

        Show
        Frederik Heremans added a comment - Deleting completed workflow is now possible due to fix for ALF-13474 (checked in on HEAD and will be available in next 4.0.X release)
        Hide
        Alfresco QA Team added a comment -

        Validated against Alfresco Enterprise v4.0.2(b911) Tomcat, Java, PostgreSQL (all installer deployed). Windows 7 SP1 x64, FireFox 12.0

        RomanCh

        Show
        Alfresco QA Team added a comment - Validated against Alfresco Enterprise v4.0.2(b911) Tomcat, Java, PostgreSQL (all installer deployed). Windows 7 SP1 x64, FireFox 12.0 RomanCh

          People

          • Assignee:
            Closed Bugs
            Reporter:
            Jeff Potts
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: