AnsweredAssumed Answered

Failed to signal transition 'null' from workflow task

Question asked by pp20218 on Jul 7, 2010
Latest reply on Sep 21, 2010 by pp20218
Hi All,

I am trying a custom advanced workflow  but I am not able to finish my job .I am getting the below error. " Please correct the errors below then click Finish.* A system error happened during the operation: 06070004 Failed to signal transition 'null' from workflow task 'jbpm$17'"."

Below are my codes.

(1)bootstrap-context.xml(/opt/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/bootstrap-context.xml)

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>


<!–
    Repository Bootstrap Sequence.

    This file specifies the initialisation (and order of initialisation) to perform during Repository startup.

    The pattern for adding new initialisation to the bootstrap sequence is as follows:

    1) Develop a bean that implements the Spring interface ApplicationListener
    2) Place the initialisation logic in the method onApplicationEvent(ApplicationEvent event)…

       public void onApplicationEvent(ApplicationEvent event)
       {
          if (event instanceof ContextRefreshedEvent)
          {
             // initialisation logic here
          }
       }

    3) Add the bean definition to this file - Note: the beans are initialised in the order they are specified.
–>

<beans>

    <!–
    The Shutdown Backstop Bean is a special bean which is used to terminate Alfresco if its
    normal shutdown does not complete in a reasonable time - it needs to go first so it can
    terminate any of the following beans if they misbehave.
    –>
    <bean id="shutdownBackstop" class="org.alfresco.repo.shutdown.ShutdownBackstop">
       <property name="timeout">
            <value>${shutdown.backstop.timeout}</value>
       </property>
       <property name="enabled">
          <value>${shutdown.backstop.enabled}</value>
       </property>  
    </bean> 


    <!– ensure that the schema is bootstrapped –>
    <bean id="schemaBootstrap" class="org.alfresco.repo.domain.schema.SchemaBootstrap" >
       <property name="localSessionFactory">
          <ref bean="&amp;sessionFactory"></ref>  <!– inject the actual factory, not a session –>
       </property>
       <property name="dialect">
          <ref bean="dialect" />
       </property>
       <property name="maximumStringLength">
          <value>${system.maximumStringLength}</value>
       </property>
       <property name="hibernateMaxExecutions">
          <value>${system.hibernateMaxExecutions}</value>
       </property>
       <property name="updateSchema">
          <value>${db.schema.update}</value>
       </property>
       <property name="stopAfterSchemaBootstrap">
          <value>${db.schema.stopAfterSchemaBootstrap}</value>
       </property>
       <property name="schemaUpdateLockRetryCount">
          <value>${db.schema.update.lockRetryCount}</value>
       </property>
       <property name="schemaUpdateLockRetryWaitSeconds">
          <value>${db.schema.update.lockRetryWaitSeconds}</value>
       </property>
       <property name="preCreateScriptUrls">
          <list>
          </list>
       </property>
       <property name="postCreateScriptUrls">
          <list>
             <value>classpath:alfresco/dbscripts/create/2.2/${db.script.dialect}/AlfrescoPostCreate-2.2-MappedFKIndexes.sql</value>
             <value>classpath:alfresco/dbscripts/create/2.2/${db.script.dialect}/AlfrescoPostCreate-2.2-Extra.sql</value>
             <value>classpath:alfresco/dbscripts/create/2.2/${db.script.dialect}/post-create-indexes-04.sql</value>
             <value>classpath:alfresco/dbscripts/create/3.0/${db.script.dialect}/create-activities-extras.sql</value>
             <value>classpath:alfresco/dbscripts/create/3.2/${db.script.dialect}/AlfrescoPostCreate-3.2-LockTables.sql</value>
             <value>classpath:alfresco/dbscripts/create/3.2/${db.script.dialect}/AlfrescoPostCreate-3.2-ContentTables.sql</value>
             <value>classpath:alfresco/dbscripts/create/3.2/${db.script.dialect}/AlfrescoPostCreate-3.2-PropertyValueTables.sql</value>
             <value>classpath:alfresco/dbscripts/create/3.2/${db.script.dialect}/AlfrescoPostCreate-3.2-AuditTables.sql</value>
             <value>classpath:alfresco/dbscripts/create/3.2/${db.script.dialect}/AlfrescoPostCreate-3.2-AvmTables.sql</value>
          </list>
       </property>
       <property name="validateUpdateScriptPatches">
          <list>
          </list>
       </property>
       <property name="preUpdateScriptPatches">
          <list>
             <ref bean="patch.schemaUpdateScript-V1.4-1" />
             <ref bean="patch.schemaUpdateScript-V1.4-2" />
             <ref bean="patch.db-V2.1-NotNullColumns" />
             <ref bean="patch.db-V2.2-ACL-From-2.1-A" />
             <ref bean="patch.db-V2.2-ACL" />
             <ref bean="patch.db-V2.2-0-CreateMissingTables" />
             <ref bean="patch.db-V2.2-Upgrade-From-2.1" />
             <ref bean="patch.db-V2.2-Upgrade-From-2.2SP1" />
             <ref bean="patch.db-V2.2-Person-3" />
             <ref bean="patch.db-V3.2-LockTables" />
             <ref bean="patch.db-V3.2-ContentTables" />
             <ref bean="patch.db-V3.2-PropertyValueTables" />
             <ref bean="patch.db-V3.2-AuditTables" />
          </list>
       </property>
       <property name="postUpdateScriptPatches">
          <list>
             <ref bean="patch.db-V1.4-TxnCommitTimeIndex" />
             <ref bean="patch.db-V2.0-ContentUrls" />
             <ref bean="patch.db-V2.1-JBPMData" />
             <ref bean="patch.db-V2.1-VersionColumns2" />
             <ref bean="patch.db-V2.1-JBPMProcessKey" />
             <ref bean="patch.db-V2.1-RemoveWcmSubmittedAspect" />
             <ref bean="patch.db-V2.1-AuditPathIndex" />
             <ref bean="patch.db-V3.0-0-CreateActivitiesExtras" />
             <ref bean="patch.db-V3.2-Remove-AVM-Issuer" />
             <ref bean="patch.db-V3.2-Modify-AVM-MimeType" />
             <ref bean="patch.db-V3.2-Upgrade-JBPM" />
          </list>
       </property>
    </bean>

    <!– Set up JGroups communication, if necessary –>
    <bean name="jgroupsChannelFactory" class="org.alfresco.repo.jgroups.AlfrescoJGroupsChannelFactory">
        <property name="clusterName">
            <value>${alfresco.cluster.name}</value>
        </property>
        <property name="protocolStackMapping">
            <map>
                <entry key="DEFAULT">
                    <value>${alfresco.jgroups.defaultProtocol}</value>
                </entry>
            </map>
        </property>
        <property name="jgroupsConfigurationUrl">
            <value>${alfresco.jgroups.configLocation}</value>
        </property>
    </bean>

    <!– Bootstrap the AVM –>
    <bean id="avmBootstrap" class="org.alfresco.repo.avm.AvmBootstrap" >
       <property name="avmLockingAwareService">
            <ref bean="avmLockingAwareService"/>
       </property>
       <property name="avmRepository">
         <ref bean="avmRepository"/>
       </property>
       <property name="permissionService">
         <ref bean="permissionService"/>
       </property>
       <property name="avmSyncService">
            <ref bean="avmSyncService"/>
       </property>
    </bean>

    <!– Bootstrap AVM Locking Service. –>
    <bean id="avmLockingBootstrap" class="org.alfresco.repo.avm.locking.AVMLockingBootstrap">
       <property name="avmLockingService" ref="avmLockingService"/>
       <property name="transactionService" ref="transactionService"/>
    </bean>
   
    <!– Load models –>
    <bean id="dictionaryRepositoryBootstrap" class="org.alfresco.repo.dictionary.DictionaryRepositoryBootstrap">

      <property name="dictionaryDAO" ref="dictionaryDAO"/>
      <property name="contentService" ref="ContentService"/>     
      <property name="searchService" ref="SearchService"/>
      <property name="transactionService" ref="transactionService"/>
      <property name="namespaceService" ref="namespaceService"/>
      <property name="nodeService" ref="NodeService"/>
      <property name="messageService" ref="messageService"/>
      <property name="tenantAdminService" ref="tenantAdminService"/>
        
      <property name="repositoryModelsLocations">
         <list>
            <ref bean="customModelsRepositoryLocation" />
         </list>       
      </property>
        
      <property name="repositoryMessagesLocations">
         <list>
            <ref bean="customMessagesRepositoryLocation" />
         </list>       
      </property>
          
   </bean>

    <!– Bootstrap Data: Concrete instances for the basic Alfresco bootstrap –>
    <bean id="systemInfoBootstrap" parent="systemInfoBootstrap-base" singleton="true" />
    <bean id="userBootstrap" parent="userBootstrap-base" singleton="true" />
    <bean id="systemBootstrap" parent="systemBootstrap-base" singleton="true" />
    <bean id="versionBootstrap" parent="versionBootstrap-base" singleton="true" />
    <bean id="version2Bootstrap" parent="version2Bootstrap-base" singleton="true" />
    <bean id="spacesArchiveBootstrap" parent="spacesArchiveBootstrap-base" singleton="true" />
    <!–
        NOOP for fresh bootstrap (will skip store creation) - provides ordering when performing a repo restore (bootstrap import)
    –>
    <bean id="spacesModelsBootstrap" parent="storeImporter" singleton="true" />
    <bean id="spacesBootstrap" parent="spacesBootstrap-base" singleton="true" />
   
    <bean id="siteAVMBootstrap" class="org.alfresco.repo.site.SiteAVMBootstrap">
        <property name="avmService" ref="AVMService" />
        <property name="permissionService" ref="PermissionService" />
        <property name="transactionService" ref="TransactionService" />
        <property name="storename">
            <value>sitestore</value>
        </property>
        <property name="rootdir">
            <value>alfresco</value>
        </property>
    </bean>
  
    <bean id="workflowBootstrap" parent="workflowDeployer">
        <property name="workflowDefinitions">
            <list>
                <props>
                    <prop key="engineId">jbpm</prop>
                    <prop key="location">alfresco/workflow/review_processdefinition.xml</prop>
                    <prop key="mimetype">text/xml</prop>
                    <prop key="redeploy">false</prop>
                </props>
                <props>
                    <prop key="engineId">jbpm</prop>
                    <prop key="location">alfresco/workflow/adhoc_processdefinition.xml</prop>
                    <prop key="mimetype">text/xml</prop>
                    <prop key="redeploy">false</prop>
                </props>
                <props>
                    <!– WCM workflow definition –>
                    <prop key="engineId">jbpm</prop>
                    <prop key="location">alfresco/workflow/submit_processdefinition.xml</prop>
                    <prop key="mimetype">text/xml</prop>
                    <prop key="redeploy">false</prop>
               </props>
               <props>
                    <!– WCM workflow definition –>
                    <prop key="engineId">jbpm</prop>
                    <prop key="location">alfresco/workflow/changerequest_processdefinition.xml</prop>
                    <prop key="mimetype">text/xml</prop>
                    <prop key="redeploy">false</prop>
               </props>
               <props>
                    <!– WCM workflow definition –>
                    <prop key="engineId">jbpm</prop>
                    <prop key="location">alfresco/workflow/submitdirect_processdefinition.xml</prop>
                    <prop key="mimetype">text/xml</prop>
                    <prop key="redeploy">false</prop>
                </props>
           
             <!– Invitation service workflow definition –>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/workflow/invitation-nominated_processdefinition.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">false</prop>
            </props>
           
            <!– Invitation service workflow definition –>
            <props>
               <prop key="engineId">jbpm</prop>
               <prop key="location">alfresco/workflow/invitation-moderated_processdefinition.xml</prop>
               <prop key="mimetype">text/xml</prop>
               <prop key="redeploy">false</prop>
            </props>

            <props>
                    <prop key="engineId">jbpm</prop>
                    <prop key="location">alfresco/workflow/publishwhitepaper_processdefinition.xml</prop>
                    <prop key="mimetype">text/xml</prop>
                    <prop key="redeploy">false</prop>
                </props>

            </list>
        </property>
        <property name="models">
            <list>
               <value>alfresco/workflow/workflowModel.xml</value>
               <value>alfresco/workflow/wcmWorkflowModel.xml</value>
               <value>alfresco/workflow/invitation-nominated-workflow-model.xml</value>
               <value>alfresco/workflow/invitation-moderated-workflow-model.xml</value>
       <value>alfresco/workflow/scWorkflowModel.xml</value>
            </list>
        </property>
        <property name="labels">
            <list>
               <value>alfresco/workflow/workflow-messages</value>
               <value>alfresco/workflow/wcm-workflow-messages</value>
               <value>alfresco/workflow/invitation-nominated-workflow-messages</value>
               <value>alfresco/workflow/invitation-moderated-workflow-messages</value>
               <value>alfresco/workflow/scWorkflow</value>
            </list>
        </property>
        <property name="repositoryWorkflowDefsLocations" ref="customWorkflowDefsRepositoryLocation"/>
    </bean>
   
    <!– Bootstrap MT (multi-tenancy) if applicable –>
    <bean id="multiTenantBootstrap" class="org.alfresco.repo.tenant.MultiTenantBootstrap" >
        <property name="tenantAdminService" ref="tenantAdminService" />
    </bean>
   
    <bean id="personDaoBootstrap" class="org.alfresco.repo.security.person.PersonDaoBootstrap" >
       <property name="personDaoImpl">
         <ref bean="personDaoImpl"/>
       </property>
    </bean>
  
    <!– Bootstrap any extensions –>
  
    <import resource="classpath*:alfresco/extension/bootstrap/*-context.xml" />

    <!– Perform index recovery before applying any patches –>
    <!– rebuild the index if required - before we check that it is there –>
   
    <bean id="indexRecoveryBootstrap" class="org.alfresco.repo.node.index.IndexRecoveryBootstrapBean" >
       <property name="indexRecoveryComponent">
           <ref bean="indexRecoveryComponent"/>
       </property>
    </bean>
   
    <bean id="avmIndexRecoveryBootstrap" class="org.alfresco.repo.node.index.IndexRecoveryBootstrapBean" >
       <property name="indexRecoveryComponent">
          <ref bean="avmIndexRecoveryComponent"/>
       </property>
    </bean>

    <!– Descriptor Service –>
    <bean id="descriptorComponent" class="org.alfresco.repo.descriptor.DescriptorServiceImpl">
       <property name="serverDescriptorDAO">
           <ref bean="serverDescriptorDAO"/>
       </property>
       <property name="currentRepoDescriptorDAO">
           <ref bean="currentRepoDescriptorDAO"/>
       </property>
       <property name="installedRepoDescriptorDAO">
           <ref bean="installedRepoDescriptorDAO"/>
       </property>
       <property name="transactionService">
           <ref bean="transactionService"/>
       </property>
    </bean>

    <!– This component checks the interconnection between the metadata, indexes and content –>
    <bean id="configurationChecker" class="org.alfresco.repo.admin.ConfigurationChecker">
       <property name="strict">
           <value>${system.bootstrap.config_check.strict}</value>
       </property>
       <property name="dirRoot">
           <value>${dir.root}</value>
       </property>
       <property name="indexRecoveryMode">
           <value>${index.recovery.mode}</value>
       </property>
       <!– helper beans –>
       <property name="transactionService">
           <ref bean="transactionService"/>
       </property>
       <property name="systemBootstrap">
           <ref bean="systemBootstrap"/>
       </property>
       <property name="namespaceService">
           <ref bean="namespaceService"/>
       </property>
       <property name="nodeService">
           <ref bean="nodeService"/>
       </property>
       <property name="searchService">
           <ref bean="searchService"/>
       </property>
       <property name="contentService">
           <ref bean="contentService"/>
       </property>
    </bean>


    <!– This component ensures that patches get applied on startup –>

    <bean id="patchExecuter" class="org.alfresco.repo.admin.patch.PatchExecuter">
        <property name="transactionService">
            <ref bean="transactionService" />
        </property>
        <property name="patchService">
            <ref bean="PatchService" />
        </property>
    </bean>

    <!– Import other Alfresco bootstrap components –>
    <import resource="classpath*:alfresco/alfresco-*-bootstrap-context.xml" />

    <!– Start module components –>

    <bean id="moduleStarter" class="org.alfresco.repo.module.ModuleStarter">
        <property name="transactionService">
            <ref bean="transactionService" />
        </property>
        <property name="moduleService">
            <ref bean="ModuleService" />
        </property>
    </bean>

    <!–  File Servers Subsystem –>
    <bean id="fileServers" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean">
        <property name="autoStart">
            <value>true</value>
        </property>
        <property name="compositePropertyTypes">
            <map>
                <entry key="nfs.user.mappings">
                    <value>org.alfresco.filesys.auth.nfs.UserMapping</value>
                </entry>
                <entry key="filesystem.acl.global.domainAccessControls">
                    <value>org.alfresco.filesys.config.acl.DomainAccessControlBean</value>
                </entry>
                <entry key="filesystem.acl.global.protocolAccessControls">
                    <value>org.alfresco.filesys.config.acl.ProtocolAccessControlBean</value>
                </entry>
                <entry key="filesystem.acl.global.userAccessControls">
                    <value>org.alfresco.filesys.config.acl.UserAccessControlBean</value>
                </entry>
                <entry key="filesystem.domainMappings">
                    <value>org.alfresco.filesys.config.DomainMappingConfigBean</value>
                </entry>
            </map>
        </property>
    </bean>

   <bean id="fileServerConfiguration" class="org.alfresco.repo.management.subsystems.SubsystemProxyFactory">
      <property name="sourceApplicationContextFactory">
         <ref bean="fileServers" />
      </property>
      <property name="interfaces">
         <list>
            <!–  Allow authentication subsystem to see file server config at runtime –>
            <value>org.alfresco.filesys.ExtendedServerConfigurationAccessor</value>
            <!– Allow export as MBean –>
            <value>org.alfresco.filesys.FileServerConfigMBean</value>
         </list>
      </property>
   </bean>

    <!– IMAP Subsystem –>
    <bean id="imap" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean">
        <property name="autoStart">
            <value>true</value>
        </property>
        <property name="compositePropertyTypes">
            <map>
               <entry key="imap.config.server.mountPoints">
                   <value>org.alfresco.repo.imap.config.ImapConfigMountPointsBean</value>
               </entry>
               <entry key="imap.config.ignore.extraction">
                   <value>org.alfresco.util.config.RepositoryFolderConfigBean</value>
               </entry>
            </map>
        </property>
    </bean>

    <!– Start the quartz scheduler –>

    <bean id="schedulerStarter" class="org.alfresco.util.SchedulerStarterBean" >
       <property name="scheduler">
           <ref bean="schedulerFactory"/>
       </property>
    </bean>

    <!–  Third party transformer Subsystem –>
    <bean id="thirdparty" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean">
        <property name="autoStart">
            <value>true</value>
        </property>
    </bean>

    <!– User registry synchronization jobs (e.g. LDAP) –>
    <bean id="Synchronization" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean">
        <property name="autoStart">
            <value>true</value>
        </property>
    </bean>

    <!– Workflow Scheduler –>
    <bean id="workflowScheduler" class="org.alfresco.repo.workflow.jbpm.JBPMScheduler">
       <property name="JBPMTemplate" ref="jbpm_template" />
    </bean>

    <!– Email Server –>
    <bean id="emailServer" class="org.alfresco.email.server.impl.subetha.SubethaEmailServer">
        <property name="enabled">
            <value>${email.server.enabled}</value>
        </property>
        <property name="domain">
            <value>${email.server.domain}</value>
        </property>
        <property name="port">
            <value>${email.server.port}</value>
        </property>
        <property name="blockedSenders">
            <value>${email.server.blocked.senders}</value>
        </property>
        <property name="allowedSenders">
            <value>${email.server.allowed.senders}</value>
        </property>
        <property name="emailService">
            <ref bean="EmailService" />
        </property>
    </bean>

    <!–  Start Auditing –>
    <bean id="audit.bootstrap" class="org.alfresco.repo.audit.AuditBootstrap">
        <property name="transactionService" ref="transactionService"/>
        <property name="auditModelRegistry" ref="auditModel.modelRegistry"/>
    </bean>

   <!– Repository helper class –>
   <bean id="repositoryHelper" class="org.alfresco.repo.model.Repository">
      <property name="transactionHelper" ref="retryingTransactionHelper" />
      <property name="namespaceService" ref="namespaceService" />
      <property name="nodeService" ref="nodeService" />
      <property name="personService" ref="personService" />
      <property name="fileFolderService" ref="fileFolderService" />
      <property name="searchService" ref="searchService" />
      <property name="tenantAdminService" ref="tenantAdminService" />
      <property name="avmService" ref="AVMService" />
      <property name="companyHomeStore"><value>${spaces.store}</value></property>
      <property name="companyHomePath"><value>/${spaces.company_home.childname}</value></property>
   </bean>

    <!– Startup Message –>

    <bean id="startupLog" class="org.alfresco.repo.descriptor.DescriptorStartupLog">
       <property name="descriptorService">
           <ref local="descriptorComponent"/>
       </property>
       <property name="tenantService">
           <ref bean="tenantService"/>
       </property>
    </bean>
   
</beans>


(2) publishwhitepaper_processdefinition.xml(/opt/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/workflow)

<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="scwf:publishwhitepaper">
   <swimlane name="initiator" />

   <swimlane name="marketing">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{people.getGroup('GROUP_marketing')}</pooledactors>
      </assignment>
   </swimlane>
   
   <swimlane name="engineering">      
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{people.getGroup('GROUP_engineering')}</pooledactors>
      </assignment>
   </swimlane>

   <start-state name="start">
      <task name="scwf:submitReviewTask" swimlane="initiator" />
      <transition name="" to="Submit"></transition>
   </start-state>
  
   <node name="Submit">
      <event type="node-enter">
         <script>
            <variable name="approveCount" access="read,write"/>
            <expression>
               approveCount = 0;
            </expression>
         </script>
      </event>
      <transition name="" to="fork1"></transition>
   </node>

   <fork name="fork1">
      <transition name="" to="Marketing Review"></transition>
      <transition name="tr2" to="Engineering Review"></transition>
   </fork>

   <task-node name="Marketing Review">
      <task name="scwf:marketingReview" swimlane="marketing" />
      <transition name="approve" to="join1">
         <script>
            <variable name="approveCount" access="read,write"/>
            <expression>
                  approveCount = approveCount + 1;
            </expression>
         </script>
      </transition>
      <transition name="reject" to="join1"></transition>
   </task-node>
  
   <task-node name="Engineering Review">

      <task name="scwf:engineeringReview" swimlane="engineering" />

      <transition name="approve" to="join1">
         <script>
            <variable name="approveCount" access="read,write"/>
            <expression>
                  approveCount = approveCount + 1;
            </expression>
         </script>     
      </transition>
      <transition name="reject" to="join1"></transition>
   </task-node>

   <join name="join1">
      <transition name="" to="All Approved"></transition>
   </join>
  
   <decision name="All Approved">
      <transition name="reject" to="Revise"></transition>
      <transition name="" to="Third Party">
         <condition>#{approveCount == 2}</condition>
      </transition>
   </decision>

   <decision name="Third Party">
      <transition name="tr2" to="Approved"></transition>
      <transition name="" to="Third Party Review">
         <condition>#{scwf_reviewerEmail!=""}</condition>
      </transition>
   </decision>
  
   <task-node name="Third Party Review">
      <event type="node-enter">
         <script>
            <variable name="notificationRecipient" access="read,write" />
            <variable name="scwf_reviewerEmail" access="read" />
            <expression>
               notificationRecipient = scwf_reviewerEmail;
            </expression>
         </script>
         <action class="org.alfresco.repo.workflow.ExternalReviewNotification"/>
      </event>

      <task name="scwf:thirdPartyReview" swimlane="initiator" >
         <timer name="thirdPartyTimer" duedate="1 minutes" transition="approve">
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                  logger.log("Third-party timer expired…approving");
               </script>
            </action>
         </timer>         
      </task>

      <transition name="approve" to="Approved"></transition>
      <transition name="reject" to="Revise"></transition>
  
   </task-node>

   <node name="Approved">
      <transition name="" to="end1">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <variable name="bpm_package" access="read" />
               <expression>
                  var setWebFlagAction = actions.create("set-web-flag");
                  setWebFlagAction.parameters["active"] = true;
                  for (var i = 0; i &lt; bpm_package.children.length; i++) {
                     setWebFlagAction.execute(bpm_package.children);
                  }         
               </expression>   
            </script>
         </action>
      </transition>
   </node>
  
   <task-node name="Revise">
      <task name="scwf:revise" swimlane="initiator"></task>
      <transition name="submit" to="Submit"></transition>
      <transition name="done" to="end1"></transition>
   </task-node>

   <end-state name="end1"></end-state>
  
</process-definition>

(3)scWorkflow.properties

#
# Submit to SC Web Workflow
#

# scWorkflowModel related strings
scwf_workflowmodel.type.scwf_submitReviewTask.title=Start SC Web Review
scwf_workflowmodel.type.scwf_submitReviewTask.description=Submit SC Web documents for review & approval to a group of people
scwf_workflowmodel.type.scwf_marketingReview.title=Marketing Review
scwf_workflowmodel.type.scwf_marketingReview.description=Review documents for impact on SomeCo marketing message
scwf_workflowmodel.type.scwf_engineeringReview.title=Engineering Review
scwf_workflowmodel.type.scwf_engineeringReview.description=Review documents for technical accuracy and best practices
scwf_workflowmodel.type.scwf_thirdPartyReview.title=Third-Party Review
scwf_workflowmodel.type.scwf_thirdPartyReview.description=Third-party reviews documents as necessary
scwf_workflowmodel.property.scwf_reviewerEmail.title=Reviewer email
scwf_workflowmodel.property.scwf_reviewerEmail.description=Third-party reviewer email address

# processdefinition related strings
scwf_publishwhitepaper.workflow.title=Publish Whitepaper to SC Web
scwf_publishwhitepaper.workflow.description=Review and approve SC Whitepaper content

scwf_publishwhitepaper.node.Marketing\ Review.transition.approve.title=Approve
scwf_publishwhitepaper.node.Marketing\ Review.transition.approve.description=Approve this change

scwf_publishwhitepaper.node.Marketing\ Review.transition.reject.title=Reject
scwf_publishwhitepaper.node.Marketing\ Review.transition.reject.description=Reject this change

scwf_publishwhitepaper.node.Engineering\ Review.transition.approve.title=Approve
scwf_publishwhitepaper.node.Engineering\ Review.transition.approve.description=Approve this change

scwf_publishwhitepaper.node.Engineering\ Review.transition.reject.title=Reject
scwf_publishwhitepaper.node.Engineering\ Review.transition.reject.description=Reject this change

scwf_publishwhitepaper.node.Third\ Party\ Review.transition.approve.title=Approve
scwf_publishwhitepaper.node.Third\ Party\ Review.transition.approve.description=Approve this change

scwf_publishwhitepaper.node.Third\ Party\ Review.transition.reject.title=Reject
scwf_publishwhitepaper.node.Third\ Party\ Review.transition.reject.description=Reject this change

scwf_publishwhitepaper.node.Revise.transition.submit.title=Resubmit
scwf_publishwhitepaper.node.Revise.transition.submit.description=Resubmit after revision

scwf_publishwhitepaper.node.Revise.transition.done.title=Abort
scwf_publishwhitepaper.node.Revise.transition.done.description=Stop the review process for this content


(4)scWorkflowModel.xml (/opt/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/workflow)

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="scwf:workflowmodel"
   xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Someco Workflow Model</description>
   <author>Optaros</author>
   <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0"
         prefix="d" />
      <import uri="http://www.alfresco.org/model/bpm/1.0"
         prefix="bpm" />
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="http://www.someco.com/model/workflow/1.0"
         prefix="scwf" />
   </namespaces>

   <types>

      <type name="scwf:submitReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>scwf:thirdPartyReviewable</aspect>
         </mandatory-aspects>
      </type>

      <type name="scwf:marketingReview">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>read_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="scwf:engineeringReview">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>read_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="scwf:thirdPartyReview">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>read_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="scwf:revise">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>
      
   </types>

   <aspects>
      <aspect name="scwf:thirdPartyReviewable">
         <title>Someco Third Party Reviewable</title>
         <properties>
            <property name="scwf:reviewerEmail">
               <type>d:text</type>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
            </property>
         </properties>
      </aspect>   
   </aspects>
</model>

(5)ExternalReviewNotification.java(org.alfresco.repo.workflow.ExternalReviewNotification.java)
package org.alfresco.repo.workflow;

import java.util.Iterator;
import java.util.List;

import org.alfresco.repo.action.executer.MailActionExecuter;
import org.alfresco.repo.workflow.jbpm.JBPMSpringActionHandler;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ActionService;
import org.apache.log4j.Logger;
import org.jbpm.graph.def.Transition;
import org.jbpm.graph.exe.ExecutionContext;
import org.springframework.beans.factory.BeanFactory;

public class ExternalReviewNotification extends JBPMSpringActionHandler {
   private static final long serialVersionUID = 1L;

   private static final String FROM_ADDRESS = "alfresco@localhost";
   private static final String SUBJECT = "Workflow task requires action";
   private static final String RECIP_PROCESS_VARIABLE = "notificationRecipient";
   
   private static Logger logger = Logger.getLogger(ExternalReviewNotification.class);
   
   private ActionService actionService;
   
   @Override
   protected void initialiseHandler(BeanFactory factory) {
      actionService = (ActionService)factory.getBean("actionService");
   }

   public void execute(ExecutionContext executionContext) throws Exception {
      logger.debug("Inside ExternalReviewNotification.execute()");
      String recipient = (String) executionContext.getVariable(ExternalReviewNotification.RECIP_PROCESS_VARIABLE);
      
      StringBuffer sb = new StringBuffer();
      sb.append("You have been assigned to a task named ");
      sb.append(executionContext.getToken().getNode().getName());
      sb.append(". Take the appropriate action by clicking one of the links below:\r\n\r\n");
      List transitionList = executionContext.getNode().getLeavingTransitions();
      for (Iterator it = transitionList.iterator(); it.hasNext(); ) {
         Transition transition = (Transition)it.next();
         sb.append(transition.getName());
         sb.append("\r\n");
         sb.append("http://localhost:8080/alfresco/service/someco/bpm/review?id=jbpm$");
         sb.append(executionContext.getProcessInstance().getId());
         sb.append("-@");
         sb.append("&action=");
         sb.append(transition.getName());
         sb.append("\r\n\r\n");
      }
      
      logger.debug("Message body:" + sb.toString());
      
      Action mailAction = this.actionService.createAction(MailActionExecuter.NAME);
        mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, ExternalReviewNotification.SUBJECT);       
        mailAction.setParameterValue(MailActionExecuter.PARAM_TO, recipient);
        mailAction.setParameterValue(MailActionExecuter.PARAM_FROM, ExternalReviewNotification.FROM_ADDRESS);
        mailAction.setParameterValue(MailActionExecuter.PARAM_TEXT, sb.toString());
       
        this.actionService.executeAction(mailAction, null);
      
        logger.debug("Mail action executed");
       
      return;
   }

}

I had taken this example from a tutorial and trying to run a new custom advanced workflow.
But getting the above mentioned error.

Can you please help me whats wrong with my code.

Thanks in advance.

Regards
PP

Outcomes