Well, let me sum this up (I am really hoping that somebody could hint me to
my mistake in this logic). I did the following:

1) I added the following to the controller: 

    
    <request-map uri="createCategoryI18nAndRollup">
        <security https="true" auth="true"/>
        <event type="service" invoke="createCategoryI18nAndRollup"/>
        <response name="success" type="view" value="categories"/>
    </request-map>


2) I added the following to my service_groups.xml file:

    <group name="createCategoryI18nAndRollup" send-mode="all" >
        <invoke name="createCategoryI18n" mode="sync"
result-to-context="true"/>
        <invoke name="createCategoryRollupI18n" mode="sync"/>
    </group>
   
 
3) I added the following to the service xml file:
  <service name="createCategoryI18n" default-entity-name="ProductCategory"
engine="entity-auto" invoke="create" auth="true">
                            <description>Create a Category</description>
                                    <permission-service 
service-name="exampleGenericPermission"
main-action="CREATE"/>
                                    <auto-attributes include="pk" mode="OUT" 
optional="false"/>
                                <auto-attributes include="nonpk" mode="INOUT" 
optional="true"/>
                                 <override name="productCategoryId" 
optional="false"/>
                                
                                
                </service>


   <service name="createCategoryRollupI18n"
default-entity-name="ProductCategoryRollup" engine="entity-auto"
invoke="create" auth="true">
                            <description>Create a Category Rollup</description>
                                    <permission-service 
service-name="exampleGenericPermission"
main-action="CREATE"/>
                                    <auto-attributes include="pk" mode="INOUT" 
optional="false"/>
                                <auto-attributes include="nonpk" mode="IN" 
optional="true"/>
                </service>

    <service name="createCategoryI18nAndRollup" engine="group"
location="createCategoryI18nAndRollup" invoke="" auth="true">
        <description>Creates a WorkEffort entity and
WorkEffortAssoc</description>
    </service>
        

4) I added the following form: 

 <form name="test" target="createCategoryI18nAndRollup" type="single" >
    
            <!-- Create Category -->
            <field name="productCategoryId" title="">
                <display/>
            </field>
            
            <field name="productCategoryTypeId" >
            <hidden value="QUICKADD_CATEGORY" />
        </field>

                <!-- Add ParentRollup -->
            <field name="fromDate" >
            <date-time type="timestamp" default-value="${nowTimestamp}"/>
        </field>
          
             <field name="parentProductCategoryId"
title="${uiLabelMap.FormFieldTitle_parentCategoryId}"
tooltip="tooltip-text">
            <drop-down allow-empty="false" current-description="" 
current="selected" no-current-selected-key="guys" >
                <entity-options description="${categoryName}"
key-field-name="productCategoryId"
entity-name="ProductCategoryRollupAndChild">
                    <entity-constraint name="parentProductCategoryId"
operator="equals" value="bproot"/> 
                    <entity-order-by field-name="categoryName"/>
                </entity-options>
            </drop-down>
        </field>
            
            
            <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit
button-type="button"/></field>
    </form>
 



With all of the above I want to: 

a) create a new ProductCategory
b) Create a new ProductCategoryRollup, where the parentProductCategoryId and
the fromDate is specified in the form


I really don't think that I got it ALL wrong, I just think that there might
be a mistake in my logic that I simply cannot grasp...
-- 
View this message in context: 
http://www.nabble.com/Form-Widget-call-multiple-services--tp21836332p21849595.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply via email to