Fixed: Set required parameter as option false at service definition level.
(OFBIZ-8358)
Thanks Avnindra Sharma and Pawan Verma for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1768256 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/applications/content/config/ContentErrorUiLabels.xml b/applications/content/config/ContentErrorUiLabels.xml
index 91f0348..ade698a 100644
--- a/applications/content/config/ContentErrorUiLabels.xml
+++ b/applications/content/config/ContentErrorUiLabels.xml
@@ -321,4 +321,7 @@
         <value xml:lang="fr">Aucun répertoire racine fourni. Veuillez indiquer le chemin dans le champ objectInfo de la ressource de donnée</value>
         <value xml:lang="zh">没有提供根目录,请在数据资源对象信息数据项中填写路径</value>
     </property>
+    <property key="ContentRequiredFieldMissingContentId">
+        <value xml:lang="en">Required Field Missing : Content Id.</value>
+    </property>
 </resource>
diff --git a/applications/content/servicedef/services_commevent.xml b/applications/content/servicedef/services_commevent.xml
index 71214d2..0db9b08 100644
--- a/applications/content/servicedef/services_commevent.xml
+++ b/applications/content/servicedef/services_commevent.xml
@@ -40,6 +40,11 @@
         <description>Create CommunicationEvent and Content</description>
         <implements service="persistContentAndAssoc"/>
         <attribute name="communicationEventId" type="String" mode="IN" optional="false"/>
+        <attribute name="contentId" type="String" mode="IN" optional="false">
+            <type-validate>
+                <fail-property resource="ContentErrorUiLabels" property="ContentRequiredFieldMissingContentId"/>
+            </type-validate>
+        </attribute>
         <attribute name="fromDate" type="java.sql.Timestamp" mode="OUT" optional="false"/>
     </service>
 
diff --git a/applications/content/servicedef/services_content.xml b/applications/content/servicedef/services_content.xml
index e53e351..a798e19 100644
--- a/applications/content/servicedef/services_content.xml
+++ b/applications/content/servicedef/services_content.xml
@@ -257,7 +257,8 @@
             location="component://content/minilang/content/ContentServices.xml" invoke="createContentAssoc">
         <description>Create a ContentAssoc</description>
         <permission-service service-name="genericContentPermission" main-action="UPDATE"/>
-        <auto-attributes include="all" mode="IN" optional="true"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <!-- deprecated fields to be removed -->
         <attribute mode="IN" name="targetOperationList" optional="true" type="List"/>
         <attribute mode="IN" name="targetOperationString" optional="true" type="String"/>
@@ -268,7 +269,7 @@
         <attribute mode="IN" name="displayFailCond" optional="true" type="Boolean"/>
         <attribute mode="INOUT" name="roleTypeList" optional="true" type="List"/>
         <attribute mode="INOUT" name="contentIdFrom" optional="true" type="String"/>
-        <override name="fromDate" mode="INOUT"/>
+        <override name="fromDate" mode="INOUT" optional="true"/>
         <!-- end of deprecated fields -->
     </service>
     <service name="updateContentAssoc" default-entity-name="ContentAssoc" engine="simple" auth="true"
@@ -402,7 +403,7 @@
             location="component://content/minilang/content/ContentServices.xml" invoke="updateSingleContentPurpose">
         <description>Removes content purposes and creates a new one</description>
         <permission-service service-name="contentManagerPermission" main-action="UPDATE"/>
-        <auto-attributes include="pk" mode="IN" optional="true"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
 
diff --git a/applications/humanres/config/HumanResErrorUiLabels.xml b/applications/humanres/config/HumanResErrorUiLabels.xml
index f4e6a4e..3f18653 100644
--- a/applications/humanres/config/HumanResErrorUiLabels.xml
+++ b/applications/humanres/config/HumanResErrorUiLabels.xml
@@ -20,4 +20,7 @@
 -->
 
 <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
+    <property key="HumanResRequiredFieldMissingTrainingClassTypeId">
+        <value xml:lang="en">Required Field Missing : Training Class Type Id.</value>
+    </property>
 </resource>
\ No newline at end of file
diff --git a/applications/humanres/servicedef/services.xml b/applications/humanres/servicedef/services.xml
index 15926c3..d940144 100644
--- a/applications/humanres/servicedef/services.xml
+++ b/applications/humanres/servicedef/services.xml
@@ -783,7 +783,11 @@
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
         <override name="approverId" optional="false"/>
-        <override name="trainingClassTypeId" optional="true"/>
+        <override name="trainingClassTypeId" optional="false">
+            <type-validate>
+                <fail-property resource="HumanResErrorUiLabels.xml" property="HumanResRequiredFieldMissingTrainingClassTypeId"/>
+            </type-validate>
+        </override>
         <override name="fromDate" optional="true"/>
         <override name="workEffortId" optional="false"/>
     </service>
@@ -794,7 +798,11 @@
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
         <override name="approverId" optional="false"/>
-        <override name="trainingClassTypeId" optional="true"/>
+        <override name="trainingClassTypeId" optional="false">
+            <type-validate>
+                <fail-property resource="HumanResErrorUiLabels.xml" property="HumanResRequiredFieldMissingTrainingClassTypeId"/>
+            </type-validate>
+        </override>
     </service>
 
     <service name="createTrainingTypes" engine="entity-auto" default-entity-name="TrainingClassType" invoke="create" auth="true">
diff --git a/applications/party/config/PartyErrorUiLabels.xml b/applications/party/config/PartyErrorUiLabels.xml
index 31153a0..93240b7 100644
--- a/applications/party/config/PartyErrorUiLabels.xml
+++ b/applications/party/config/PartyErrorUiLabels.xml
@@ -1304,4 +1304,28 @@
         <value xml:lang="zh">无法更新人员信息 (写失败):${0}</value>
         <value xml:lang="zh-TW">無法更新人員資訊 (寫失敗):${0}</value>
     </property>
+    <property key="PartyRequiredFieldMissingContactMechTypeId">
+        <value xml:lang="en">Required Field Missing : ContactMech Type Id.</value>
+    </property>
+    <property key="PartyRequiredFieldMissingCurrentStatusId">
+        <value xml:lang="en">Required Field Missing : Current Status Id.</value>
+    </property>
+    <property key="PartyRequiredFieldMissingWorkEffortName">
+        <value xml:lang="en">Required Field Missing : WorkEffort Name.</value>
+    </property>
+    <property key="PartyRequiredFieldMissingWorkEffortTypeId">
+        <value xml:lang="en">Required Field Missing : WorkEffort Type Id.</value>
+    </property>
+    <property key="PartyRequiredFieldMissingPartyIdTo">
+        <value xml:lang="en">Required Field Missing : Party Id To.</value>
+    </property>
+    <property key="PartyRequiredFieldMissingAddress1">
+        <value xml:lang="en">Required Field Missing : Address1.</value>
+    </property>
+    <property key="PartyRequiredFieldMissingCity">
+        <value xml:lang="en">Required Field Missing : City.</value>
+    </property>
+    <property key="PartyRequiredFieldMissingPostalCode">
+        <value xml:lang="en">Required Field Missing : Postal Code.</value>
+    </property>
 </resource>
diff --git a/applications/party/servicedef/services.xml b/applications/party/servicedef/services.xml
index 41ad5f9..9968276 100644
--- a/applications/party/servicedef/services.xml
+++ b/applications/party/servicedef/services.xml
@@ -392,6 +392,11 @@
         <auto-attributes entity-name="PartyContactMech" include="all" mode="IN" optional="true"/>
         <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
         <attribute name="contactMechId" type="String" mode="INOUT" optional="true"/>
+        <attribute name="contactMechTypeId" type="String" mode="IN" optional="false">
+            <type-validate>
+                <fail-property resource="PartyErrorUiLabels" property="PartyRequiredFieldMissingContactMechTypeId"/>
+            </type-validate>
+        </attribute>
     </service>
     <service name="updateContactMech" engine="simple"
             location="component://party/minilang/contact/ContactMechServices.xml" invoke="updateContactMech" auth="true">
@@ -845,8 +850,24 @@
         <description>Creates a WorkEffort entity and CommunicationEventWorkEff</description>
         <auto-attributes include="pk" mode="INOUT" optional="true" entity-name="WorkEffort"/>
         <auto-attributes include="nonpk" mode="IN" optional="true" entity-name="WorkEffort"/>
-        <auto-attributes include="pk" mode="INOUT" optional="true" entity-name="CommunicationEventWorkEff"/>
+        <auto-attributes include="pk" mode="INOUT" optional="false" entity-name="CommunicationEventWorkEff"/>
         <auto-attributes include="nonpk" mode="IN" optional="true" entity-name="CommunicationEventWorkEff"/>
+        <override name="workEffortId" optional="true"/>
+        <override name="currentStatusId" optional="false">
+            <type-validate>
+                <fail-property resource="WorkEffortUiLabels" property="PartyRequiredFieldMissingCurrentStatusId"/>
+            </type-validate>
+        </override>
+        <override name="workEffortName" optional="false">
+            <type-validate>
+                <fail-property resource="WorkEffortUiLabels" property="PartyRequiredFieldMissingWorkEffortName"/>
+            </type-validate>
+        </override>
+        <override name="workEffortTypeId" optional="false">
+            <type-validate>
+                <fail-property resource="WorkEffortUiLabels" property="PartyRequiredFieldMissingWorkEffortTypeId"/>
+            </type-validate>
+        </override>
     </service>
     <service name="setCommEventRoleToRead" engine="simple" default-entity-name="CommunicationEventRole"
         location="component://party/minilang/communication/CommunicationEventServices.xml" invoke="setCommEventRoleToRead" auth="false">
@@ -1205,6 +1226,7 @@
         <attribute name="setShippingPurpose" type="String" mode="IN" optional="true"/>
         <attribute name="setBillingPurpose" type="String" mode="IN" optional="true"/>
         <attribute name="productStoreId" type="String" mode="IN" optional="true"/>
+        <override name="contactMechId" optional="false"/>
     </service>
     <service name="updateContactMechAndPurposes" engine="simple" location="component://party/minilang/contact/PartyContactMechServices.xml" invoke="updateContactMechAndPurposes">
         <description>Update postal address, telecom number and purposes. The setShippingPurpose and setBillingPurpose enable the service to create purposes for TelecomNumber</description>
@@ -1251,6 +1273,21 @@
         <attribute name="userLogin" type="org.apache.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
         <attribute name="contactMechPurposeTypeId" type="String" mode="IN" optional="true"/>
         <attribute name="contactMechId" type="String" mode="INOUT" optional="true"/>
+        <override name="address1" optional="false">
+            <type-validate>
+                <fail-property resource="PartyErrorUiLabels" property="PartyRequiredFieldMissingAddress1"/>
+            </type-validate>
+        </override>
+        <override name="city" optional="false">
+            <type-validate>
+                <fail-property resource="PartyErrorUiLabels" property="PartyRequiredFieldMissingCity"/>
+            </type-validate>
+        </override>
+        <override name="postalCode" optional="false">
+            <type-validate>
+                <fail-property resource="PartyErrorUiLabels" property="PartyRequiredFieldMissingPostalCode"/>
+            </type-validate>
+        </override>
     </service>
 
      <!--  bounced message processing -->
@@ -1295,6 +1332,11 @@
         <attribute name="countryCode" type="String" mode="IN" optional="true"/>
         <attribute name="emailType" type="String" mode="IN" optional="true"/>
         <attribute name="productStoreId" type="String" mode="IN" optional="true"/>
+        <override name="partyIdTo" optional="false">
+            <type-validate>
+                <fail-property resource="PartyErrorUiLabels" property="PartyRequiredFieldMissingPartyIdTo"/>
+            </type-validate>
+        </override>
     </service>
     
     <!-- send account activated email notification -->
diff --git a/applications/workeffort/config/WorkEffortUiLabels.xml b/applications/workeffort/config/WorkEffortUiLabels.xml
index bbd41a3..eb62e59 100644
--- a/applications/workeffort/config/WorkEffortUiLabels.xml
+++ b/applications/workeffort/config/WorkEffortUiLabels.xml
@@ -5406,4 +5406,31 @@
         <value xml:lang="zh">把工作流行动指派给用户角色</value>
         <value xml:lang="zh-TW">把工作流程行動指派給使用者角色</value>
     </property>
+    <property key="WorkEffortRequiredFieldMissingQuoteId">
+        <value xml:lang="en">Required Field Missing : Quote Id.</value>
+    </property>
+    <property key="WorkEffortRequiredFieldMissingCustRequestId">
+        <value xml:lang="en">Required Field Missing : Cust Request Id.</value>
+    </property>
+    <property key="WorkEffortRequiredFieldMissingWorkEffortId">
+        <value xml:lang="en">Required Field Missing : WorkEffort Id.</value>
+    </property>
+    <property key="WorkEffortRequiredFieldMissingWorkEffortId">
+        <value xml:lang="en">Required Field Missing : WorkEffort Id.</value>
+    </property>
+    <property key="WorkEffortRequiredFieldMissingRequirementTypeId">
+        <value xml:lang="en">Required Field Missing : Requirement Type Id.</value>
+    </property>
+    <property key="WorkEffortRequiredFieldMissingContactMechTypeId">
+        <value xml:lang="en">Required Field Missing : ContactMech Type Id.</value>
+    </property>
+    <property key="WorkEffortRequiredFieldMissingCurrentStatusId">
+        <value xml:lang="en">Required Field Missing : Current Status Id.</value>
+    </property>
+    <property key="WorkEffortRequiredFieldMissingWorkEffortName">
+        <value xml:lang="en">Required Field Missing : WorkEffort Name.</value>
+    </property>
+    <property key="WorkEffortRequiredFieldMissingWorkEffortTypeId">
+        <value xml:lang="en">Required Field Missing : WorkEffort Type Id.</value>
+    </property>
 </resource>