AnsweredAssumed Answered

status aspect on workflow

Question asked by evdgeest on Mar 26, 2007
Latest reply on Oct 3, 2012 by sradha
Hi,

I want to arrange that the workflow adds an aspect to the document every time the workflow changes between tasks, so when you view the details of that document you see his status in the workflow.

I added an aspect in the testmodel, and in the process definition I added a script in the transition part of the start-task. I keep on getting the errors below when starting the advanced workflow.

13:20:30,194 ERROR [org.jbpm.graph.def.GraphElement] action threw exception: Failed to execute supplied script: Wrapped java.lang.NullPointerException (AlfrescoScript#1)
org.alfresco.service.cmr.repository.ScriptException: Failed to execute supplied script: Wrapped java.lang.NullPointerException (AlfrescoScript#1)

Caused by: org.alfresco.error.AlfrescoRuntimeException: Wrapped java.lang.NullPointerException (AlfrescoScript#1)

Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (AlfrescoScript#1)

Caused by: java.lang.NullPointerException
13:20:30,444 ERROR [org.alfresco.web.ui.common.Utils] A system error happened during the operation: Failed to signal transition 'null' from workflow task 'jbpm$118'
org.alfresco.service.cmr.workflow.WorkflowException: Failed to signal transition 'null' from workflow task 'jbpm$118'

Caused by: org.jbpm.graph.def.DelegationException

Caused by: org.alfresco.service.cmr.repository.ScriptException: Failed to execute supplied script: Wrapped java.lang.NullPointerException (AlfrescoScript#1)

Caused by: org.alfresco.error.AlfrescoRuntimeException: Wrapped java.lang.NullPointerException (AlfrescoScript#1)

Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (AlfrescoScript#1)

Caused by: java.lang.NullPointerException
testmodel.xml
  <namespaces>
    <namespace uri="test.model" prefix="test"/>
  </namespaces>


  <aspects>
      <!– Aspect: Workflow status –>
      <aspect name="test:Workflow_Status">
        <title>Workflow Status</title>
        <properties>
          <property name="test:BpmNr">
            <title>Workflow ID</title>
            <type>d:text</type>
          </property>
          <property name="test:BpmStatus">
            <title>Workflow status</title>
            <type>d:text</type>
          </property>
        </properties>
      </aspect>

  </aspects>

test_processdefinition.xml
  <start-state name="start">
    <task name="wf:submitBehandelTask" swimlane="initiator"/>
    <transition name="test1" to="script">
        <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
          <script>
            var props = new Array(1);
            props["test:BpmNr"] = "testnr";
            bpm_package.addAspect ("test:Workflow_Status");

            executionContext.leaveNode();
          </script>
        </action>
    </transition>
  </start-state>

I hope you can tell me what I am doing wrong!

Thanks in advance,

Edwin

Outcomes