mini lang question on simple method call

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

mini lang question on simple method call

joelfradkin@gmail.com
I copied the concepts from the tutorial using create, update, delete person.

I have had a hard time (Mostly i just dont understand the mini lang stuff).

I got my create and delete to work ok, but my update is giving the error:
Error running the simple-method: Entity value not found with name: lookedUpValue Method = updateEdiHeader on the line setting non pk fields

This is my simple method
    <simple-method method-name="updateEdiHeader" short-description="update a EDIHeader">
        <entity-one entity-name="EdiHeader" value-field="lookedUpValue"/> 
        <set-nonpk-fields map="parameters"  value-field="lookedUpValue"/>
        <store-value value-field="lookedUpValue"/>
        <log level="info" message="=======EDIHeader record updated for EDIHeaderId=====${lookedUpValue.EDIHeaderId}"/>
    </simple-method>

Here is my service def entry
    <service name="updateEdiHeader" default-entity-name="EDIHeader" engine="simple"
            location="component://edi/script/org/tcg/edi/EDIServices.xml" invoke="updateEdiHeader" auth="true">
        <description>Update a EDI Header</description>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
    </service>

Any ideas as to what I am missing would be of great help.
I know I got delete working, but still am not sure what I changed. I think I might of used the wrong case on the entity, I fissed with it a bit and finally in the end its back to what I started with.

    <simple-method method-name="deleteEdiHeader" short-description="delete a EDIHeader">
        <entity-one entity-name="EdiHeader" value-field="lookedUpValue" auto-field-map="true"/> 
        <remove-value value-field="lookedUpValue"/>
        <log level="info" message="=======EDIHeader record deleted for EDIHeaderId=====${lookedUpValue.EDIHeaderId}"/>
    </simple-method>





Joel Fradkin
Reply | Threaded
Open this post in threaded view
|

Re: mini lang question on simple method call

joelfradkin@gmail.com
I got it working.
I am still a bit stumped.
The tutorial uses.
        <auto-attributes include="pk" mode="IN" optional="false"/>
to set the key fields for the service (in service def).
If I use that it does not find the record.
I tried
        <attribute name="ediHeaderId" mode="IN" type="String" optional="false"/>
and it works.
Am i doing something wrong in my entity creation (entity def)?

Sorry for bugging you all with dumb questions. I did see a previous list question and one of the answers was you have to have all the PK fields for it to find the record.
Joel Fradkin