cancel
Showing results for 
Search instead for 
Did you mean: 

Probelm with deploying custom workflow.

javed_afroz
Champ in-the-making
Champ in-the-making
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.
3 REPLIES 3

abhashree
Champ in-the-making
Champ in-the-making
Hi,

your processdefinition file and basic.xml files are seem to be correct.
I think the problem arises due to the namespace mapping.
Just add the namespace and import files  in alfresco/extension/customModel.xml .
This may resolve the conflict arise due to namespace.
Please follow the workflow administrator guide for proper guidance.

javed_afroz
Champ in-the-making
Champ in-the-making
Thanks for you reply, Can you please tell me how to add a new namespace in Alfresco?

javed_afroz
Champ in-the-making
Champ in-the-making
I have defined a new namespace like :

<namespaces>
   <namespace uri="http://www.alfresco.com/model/basicWorkFlowModel/1.0" prefix="wf"/>
  </namespaces>


Now I am getting following exception while deploying model:

14:32:58,359 UserSmiley Frustratedystem ERROR [filesys.repo.NodeMonitor] org.alfresco.service.namespace.NamespaceException: A namespace prefix is not registered for uri http://www.alfresco.com/model/basicWorkFlowModel/1.0
14:32:58,421 User:admin ERROR [repo.transaction.AlfrescoTransactionSupport] After completion (committed) listener exception:   listener: org.alfresco.repo.action.ActionTrackingServiceImpl$1@171a8f6
org.alfresco.service.namespace.NamespaceException: A namespace prefix is not registered for uri http://www.alfresco.com/model/basicWorkFlowModel/1.0
        at org.alfresco.service.namespace.QName.toPrefixString(QName.java:403)
        at org.alfresco.cmis.mapping.CMISMapping.getCmisTypeId(CMISMapping.java:
366)
        at org.alfresco.cmis.mapping.CMISMapping.getCmisTypeId(CMISMapping.java:
403)
        at org.alfresco.cmis.dictionary.CMISStrictDictionaryService.createTypeDe
fs(CMISStrictDictionaryService.java:67)
        at org.alfresco.cmis.dictionary.CMISStrictDictionaryService.createDefini
tions(CMISStrictDictionaryService.java:47)
        at org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.init(CMISA
bstractDictionaryService.java:407)
        at org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.afterDicti
onaryInit(CMISAbstractDictionaryService.java:496)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.initDictionaryRegistry
(DictionaryDAOImpl.java:253)