Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

From this place if you want to run these services then you can run them by webtools--> Run Service . By this place you can test your services.

 Note: At this place you must read http://www.nabble.com/The-fancy-new-entity-auto-service-execution-engine-td18674040.htmlImage Added. This feature has been recently added against the traditional approach of writing CrUD operations for an entity.

           This new feature enables you to just define the services by mentioning the operation you want to perform.Basically just set the engine attribute to "entity-auto" and the   invoke attribute to "create", "update", or "delete".
like you can take a look in the following code from services.xml of example component:  

Code Block

   <service name="createExample" default-entity-name="Example" engine="entity-auto" invoke="create" auth="true">
        <description>Create a Example</description>
        <permission-service service-name="exampleGenericPermission" main-action="CREATE"/>
        <auto-attributes include="pk" mode="OUT" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <override name="exampleTypeId" optional="false"/>
        <override name="statusId" optional="false"/>
        <override name="exampleName" optional="false"/>
    </service>     

 engine="entity-auto" invoke="create" play the role for creating the records for the default-entity "Example."

Here for practice you may go by following further steps those steps will help you in understanding the concept then onwards you can practice the pattern given above  in your code only.

Writing CRUD operations for Person entity:

...

Step - 2 :  Now you have to create a file by name "eecas.xml" in "entitydef" directory, which will be in your component directory "practice". Eeca definition will come here. (Take reference from eecas.xml of "accounting" component). This will be :

    <!-- To create party role whenever a party is created -->
    <eca entity="Party" operation="create" event="return">
        <condition field-name="partyId" operator="is-not-empty"/>
        <action service="createPartyRoleCustomer" mode="sync"/>
    </eca>

...

 Create a group service by name "partyGroup" like :

<!-- Group service -->
    <service name="partyGroup" engine="group" auth="true">
        <description>Creates a party, person and party role Client</description>
        <group>
            <invoke name="createPracticePerson" result-to-context="true"/>
            <invoke name="createPartyRoleClient"/>
        </group>
    </service>

...