AnsweredAssumed Answered

Probelm with deploying custom workflow.

Question asked by javed_afroz on Apr 10, 2011
Latest reply on Apr 11, 2011 by javed_afroz
Hi,
      I am new to custom workflow development in alfresco. I am developing and deploying workflow using eclipse designer plugin. Following is my processdefinition.xml

<?xml version="1.0" encoding="UTF-8"?>
<process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="wf:basic">

   <swimlane name="initiator"></swimlane>
   <swimlane name="assignee">
      <assignment actor-id="#{bpm_assignee}"></assignment>
   </swimlane>
   <start-state name="Start">
      <task name="wf:startApprovalTask" swimlane="initiator">
         <description>
            approval start
         </description>
      </task>
      <transition to="Approval" name="to_approve"></transition>
   </start-state>

   <decision name="Decision">
      <handler class="com.sample.action.ApprovalHandler"></handler>
      <transition to="Accepted" name="Yes"></transition>
      <transition to="Rejected" name="No"></transition>
   </decision>

   <node name="Accepted">
      <action name="AcceptedAction" class="com.sample.action.MessageActionHandler">
         <message>
            Accepted
         </message>
      </action>
      <transition to="End" name="to_end_accepted"></transition>
   </node>

   <node name="Rejected">
      <action name="RejectedAction" class="com.sample.action.MessageActionHandler">
         <message>
            Rejected
         </message>
      </action>
      <transition to="End" name="to_end_rejected"></transition>
   </node>

   <task-node name="Approval">
      <task name="wf:approvalTask" swimlane="assignee"></task>
      <transition to="Decision" name="to_decide"></transition>
   </task-node>

   <end-state name="End"></end-state>

</process-definition>

I have developed a custom workflow model which I have kept under alfresco\extension\basic.xml. I am deployinh this model using  repoadmin-console.jsp.

basic.xml

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

<model name="wf:basicWorkFlowModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

  <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>

  <namespaces>
     <namespace uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"/>
  </namespaces>
     
  <types>

     <type name="wf:startApprovalTask">
        <parent>bpm:startTask</parent>
        
        <properties>
           <property name="wf:notify">
              <type>d:boolean</type>
              <default>false</default>
           </property>
        </properties>

        <mandatory-aspects>
           <aspect>bpm:assignee</aspect>
        </mandatory-aspects>
     </type>

     <type name="wf:approvalTask">
        <parent>bpm:workflowTask</parent>
      <properties>
           <property name="wf:decision">
              <type>d:boolean</type>
              <default>false</default>
           </property>
        </properties>
     </type>
     
  </types>
  
</model>

When i am deploying using repoadmin-console.jsp. It is getting deployed successfully but in console it is showing following error

"00:20:41,843 User:admin ERROR [repo.transaction.AlfrescoTransactionSupport] Afte
r completion (committed) listener exception:
   listener: org.alfresco.repo.action.ActionTrackingServiceImpl$1@433c6
org.alfresco.service.namespace.NamespaceException: URI http://www.alfresco.org/m
odel/workflow/1.0 has already been defined"

In UI also it is not starting workflow, I have tried importing uri, but that also dint worked. I am stuck, please help me out.

Thanks in advance.

Outcomes