<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2010-2026 beCPG. 
   
  This file is part of beCPG 
   
  beCPG is free software: you can redistribute it and/or modify 
  it under the terms of the GNU Lesser General Public License as published by 
  the Free Software Foundation, either version 3 of the License, or 
  (at your option) any later version. 
   
  beCPG is distributed in the hope that it will be useful, 
  but WITHOUT ANY WARRANTY; without even the implied warranty of 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  GNU Lesser General Public License for more details. 
   
  You should have received a copy of the GNU Lesser General Public License along with beCPG. If not, see <http://www.gnu.org/licenses/>.
-->
<model xmlns="http://www.alfresco.org/model/dictionary/1.0" name="ncwf:nonConformityModel">
    <author>beCPG</author>
    <version>1.0</version>
    <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"/>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
        <import uri="http://www.bcpg.fr/model/becpg/1.0" prefix="bcpg"/>
        <import uri="http://www.bcpg.fr/model/quality/1.0" prefix="qa"/>
        <import uri="http://www.bcpg.fr/model/workflow/1.0" prefix="bcpgwf" />
    </imports>
    <namespaces>
        <namespace uri="http://www.bcpg.fr/model/nc-workflow/1.0" prefix="ncwf"/>
    </namespaces>
    <data-types/>
    <constraints>
        <constraint name="ncwf:claimRejectedStates" type="LIST">
            <parameter name="allowedValues">
                <list>
                    <value>none</value>
                    <value>entry</value>
                    <value>analysis</value>
                    <value>classification</value>
                    <value>treatment</value>
                    <value>response</value>
                </list>
            </parameter>
            <parameter name="caseSensitive">
                <value>true</value>
            </parameter>
        </constraint>
    </constraints>
    <types>
        <type name="ncwf:startTask">
            <parent>bpm:startTask</parent>
           <properties/>
            <overrides>
                <property name="bpm:packageActionGroup">
                    <mandatory>false</mandatory>
                    <default>add_package_item_actions</default>
                    <constraints/>
                </property>
                <property name="bpm:packageItemActionGroup">
                    <mandatory>false</mandatory>
                    <default>edit_package_item_actions</default>
                    <constraints/>
                </property>
            </overrides>
            <mandatory-aspects>	
              	<aspect>qa:batchAspect</aspect>
              	<aspect>bcpg:clientsAspect</aspect>
               <aspect>bcpg:suppliersAspect</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:analysisTask">
            <parent>bpm:workflowTask</parent>
            <properties>
                <property name="ncwf:needPrevAction">
                    <type>d:boolean</type>
                    <mandatory>false</mandatory>
                    <index enabled="true"/>
                </property>
            </properties>
            <associations>
                <association name="ncwf:corrActionActor">
                    <source>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory enforced="false">true</mandatory>
                        <many>false</many>
                    </target>
                </association>
                <association name="ncwf:checkActor">
                    <source>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory enforced="false">true</mandatory>
                        <many>false</many>
                    </target>
                </association>
            </associations>
            <overrides/>
            <mandatory-aspects>
                <aspect>ncwf:correctiveAction</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:corrActionTask">
            <parent>bpm:workflowTask</parent>
            <properties/>
            <associations/>
            <overrides/>
            <mandatory-aspects>
                <aspect>ncwf:correctiveAction</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:checkTask">
            <parent>bpm:workflowTask</parent>
            <properties/>
            <associations/>
            <overrides/>
            <mandatory-aspects>
                <aspect>ncwf:correctiveAction</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:notificationTask">
            <parent>bpm:workflowTask</parent>
            <properties/>
            <associations/>
            <overrides/>
            <mandatory-aspects>
                <aspect>ncwf:correctiveAction</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:prevActionTask">
            <parent>bpm:workflowTask</parent>
            <properties/>
            <associations/>
            <overrides/>
            <mandatory-aspects/>
        </type>
        <type name="ncwf:workTask">
            <parent>bpm:workflowTask</parent>
            <properties>
                <property name="ncwf:previousComment">
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <index enabled="true"/>
                </property>
            </properties>
            <associations>
                <association name="ncwf:assignee">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory enforced="false">false</mandatory>
                        <many>false</many>
                    </target>
                </association>
            </associations>
            <overrides/>
            <mandatory-aspects>
                <aspect>ncwf:correctiveAction</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:claimStartTask">
            <title>Saisie réclamation</title>
            <parent>bpm:startTask</parent>
            <properties>
            	 <property name="ncwf:claimStartAsDraft">
                    <title>Créer comme brouillon</title>
                    <type>d:boolean</type>
                    <mandatory>false</mandatory>
                </property>
            </properties>
            <associations/>
            <overrides>
                <property name="bpm:packageActionGroup">
                    <mandatory>false</mandatory>
                    <default>add_package_item_actions</default>
                    <constraints/>
                </property>
                <property name="bpm:packageItemActionGroup">
                    <mandatory>false</mandatory>
                    <default>edit_package_item_actions</default>
                    <constraints/>
                </property>
            </overrides>
            <mandatory-aspects>
            	<aspect>qa:claimAspect</aspect>
            	<aspect>qa:batchAspect</aspect>
            	<aspect>ncwf:claimRejectedAspect</aspect>
            	<aspect>bcpgwf:notificationAspect</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:claimAnalysisTask">
            <title>Orientation réclamation</title>
            <parent>bpm:workflowTask</parent>
           <overrides>
                <property name="bpm:packageActionGroup">
                    <mandatory>false</mandatory>
                    <default>add_package_item_actions</default>
                    <constraints/>
                </property>
            </overrides>
            <mandatory-aspects>
            	<aspect>qa:claimAspect</aspect>
            	<aspect>qa:batchAspect</aspect>
            	<aspect>qa:claimTreatementAspect</aspect>
            	<aspect>ncwf:claimDueDateAspect</aspect>
            	<aspect>qa:claimResponseAspect</aspect>
            	<aspect>ncwf:claimRejectedAspect</aspect>
            	<aspect>bcpgwf:notificationAspect</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:claimTreatmentTask">
            <title>Traitement réclamation</title>
            <parent>bpm:workflowTask</parent>
            <properties/>
            <associations/>
             <overrides>
                <property name="bpm:packageActionGroup">
                    <mandatory>false</mandatory>
                    <default>add_package_item_actions</default>
                    <constraints/>
                </property>
            </overrides>
            <mandatory-aspects>
            	<aspect>qa:claimAspect</aspect>
            	<aspect>qa:batchAspect</aspect>
            	<aspect>qa:claimTreatementAspect</aspect>
            	<aspect>qa:claimResponseAspect</aspect>
            	<aspect>ncwf:claimRejectedAspect</aspect>
            	<aspect>ncwf:claimDueDateAspect</aspect>
            	<aspect>bcpgwf:notificationAspect</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:claimResponseTask">
            <title>Réponse réclamation</title>
            <parent>bpm:workflowTask</parent>
            <properties/>
            <associations/>
            <overrides>
                <property name="bpm:packageActionGroup">
                    <mandatory>false</mandatory>
                    <default>add_package_item_actions</default>
                    <constraints/>
                </property>
            </overrides>
             <mandatory-aspects>
             	<aspect>qa:claimAspect</aspect>
             	<aspect>qa:batchAspect</aspect>
            	<aspect>qa:claimTreatementAspect</aspect>
            	<aspect>qa:claimResponseAspect</aspect>
            	<aspect>ncwf:claimRejectedAspect</aspect>
            	<aspect>ncwf:claimDueDateAspect</aspect>
            	<aspect>bcpgwf:notificationAspect</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:claimClosingTask">
            <title>Clôture réclamation</title>
            <parent>bpm:workflowTask</parent>
            <properties/>
            <associations/>
             <overrides>
                <property name="bpm:packageActionGroup">
                    <mandatory>false</mandatory>
                    <default>add_package_item_actions</default>
                    <constraints/>
                </property>
            </overrides>
             <mandatory-aspects>
               <aspect>qa:claimAspect</aspect>
               <aspect>qa:batchAspect</aspect>
            	<aspect>qa:claimTreatementAspect</aspect>
            	<aspect>qa:claimResponseAspect</aspect>
            	<aspect>qa:claimClosingAspect</aspect>
            	<aspect>ncwf:claimRejectedAspect</aspect>
            	<aspect>ncwf:claimDueDateAspect</aspect>
            	<aspect>bcpgwf:notificationAspect</aspect>
            </mandatory-aspects>
        </type>
        <type name="ncwf:claimClassificationTask">
            <title>Classification réclamation</title>
            <parent>bpm:workflowTask</parent>
            <properties/>
            <associations/>
             <overrides>
                <property name="bpm:packageActionGroup">
                    <mandatory>false</mandatory>
                    <default>add_package_item_actions</default>
                    <constraints/>
                </property>
            </overrides>
             <mandatory-aspects>
             	<aspect>qa:claimAspect</aspect>
             	<aspect>qa:claimTreatementAspect</aspect>
            	<aspect>qa:claimResponseAspect</aspect>
            	<aspect>ncwf:claimDueDateAspect</aspect>
             	<aspect>qa:batchAspect</aspect>
             	<aspect>bcpgwf:notificationAspect</aspect>
            </mandatory-aspects>
        </type>
    </types>
    <aspects>
        <aspect name="ncwf:correctiveAction">
            <properties>
                <property name="ncwf:ncState">
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <index enabled="true"/>
                    <constraints>
                        <constraint ref="qa:ncStates"/>
                    </constraints>
                </property>
            </properties>
            <associations/>
            <overrides/>
            <mandatory-aspects/>
        </aspect>
       <aspect name="ncwf:claimDueDateAspect">
			<properties>
                <property name="ncwf:claimTreatmentDueDate">
                    <title>Délai maximum demandé pour le Traitement</title>
                    <type>d:date</type>
                    <mandatory>false</mandatory>
                    <index enabled="true">
                        <atomic>false</atomic>
                        <stored>false</stored>
                        <tokenised>TRUE</tokenised>
                    </index>
                </property>
                <property name="ncwf:claimResponseDueDate">
                    <title>Délai maximum demandé pour la Réponse</title>
                    <type>d:date</type>
                    <mandatory>false</mandatory>
                    <index enabled="true">
                        <atomic>false</atomic>
                        <stored>false</stored>
                        <tokenised>TRUE</tokenised>
                    </index>
                </property>
            </properties>       
       </aspect>
        
        <aspect name="ncwf:claimRejectedAspect">
            <properties>
                <property name="ncwf:claimRejectedState">
                    <title>Refus</title>
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                    <default>none</default>
                    <index enabled="true">
                        <atomic>false</atomic>
                        <stored>false</stored>
                        <tokenised>TRUE</tokenised>
                    </index>
                    <constraints>
                        <constraint ref="ncwf:claimRejectedStates"/>
                    </constraints>
                </property>
                <property name="ncwf:claimRejectedCause">
                    <title>Motif de refus</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <index enabled="true">
                        <atomic>false</atomic>
                        <stored>false</stored>
                        <tokenised>TRUE</tokenised>
                    </index>
                </property>
            </properties>
            <associations/>
            <overrides/>
            <mandatory-aspects/>
        </aspect>
    </aspects>
</model>
