Defining a new view entity (Scope: Detail Party:General Entities)

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

Defining a new view entity (Scope: Detail Party:General Entities)

justin.g.robinson
Ok my last email to the mailing list was rather glib, no suprise
no-one replied. (Sorry)

I need to define a view entity that can encapsulates the person-party
(of type customer) related to party-group (of type account team) & the
person-party (of type employee).
So that I can trace the relationships  person-parties (of type
customer) to the person-party (of type employee) through the common
party of party-group (of type account team).

I know it will involve one to many relationships, but I can't quite
viualize how to define the view entity.
After looking at 'The Big Book of OFBiz Diagrams' Detail Party:General
Entities am not sure which entities need to be joined in the view to
get this done.

Can anyone shed some light about how to do about this?
Thanks in advance.

--
Regards,
Justin
Venture-Net Research & Development
Reply | Threaded
Open this post in threaded view
|

Re: Defining a new view entity (Scope: Detail Party:General Entities)

justin.g.robinson
Thanks for the replies on my related topic I only saw them after I
rehashed & created a new more appropriate topic. I understand what you
were saying about opentaps vs ofbiz appropriateness, my understanding
of where one begins and the other ends is more complete now.
I thought of a much simpler way to achieve my aim, but the application
logic is irrelevant to this forum. I would like some advice on the
simplest way to modify a view, by joining an entity that has 2 primary
keys.

I'd like to get the attrValue field, into my
CustRequestAndPartyRelationshipAndRole view entity, but the relation
must be by "custRequestId" & "attrName" which are both primary keys. I
can't figure out how to do this.

<entity entity-name="CustRequestAttribute"
            package-name="org.ofbiz.order.request"
            title="Customer Request Attribute Entity">
      <field name="custRequestId" type="id-ne"></field>
      <field name="attrName" type="id-long-ne"></field>
      <field name="attrValue" type="value"></field>
      <prim-key field="custRequestId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="CUST_REQ_ATTR"
rel-entity-name="CustRequest">
        <key-map field-name="custRequestId"/>
      </relation>
      <relation type="many" rel-entity-name="CustRequestTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>

my attempt at the modified view:

<view-entity entity-name="CustRequestAndPartyRelationshipAndRole"
                 package-name="com.opensourcestrategies.crmsfa.marketing"
                 title="CustRequest plus status,type and category info">
        <member-entity entity-alias="CR" entity-name="CustRequest"/>
        <member-entity entity-alias="SI" entity-name="StatusItem"/>
        <member-entity entity-alias="CRT" entity-name="CustRequestType"/>
        <member-entity entity-alias="CRC" entity-name="CustRequestCategory"/>
        <member-entity entity-alias="CRR" entity-name="CustRequestRole"/>
        <member-entity entity-alias="PR" entity-name="PartyRelationship"/>
        <member-entity entity-alias="PRDS"
entity-name="PartyRoleNameDetailSupplementalData"/>
        <member-entity entity-alias="CRA"
entity-name="CustRequestAttribute"/>
        <alias-all entity-alias="CR">
                <exclude field="reason"/>
        </alias-all>
        <alias entity-alias="CR" name="custRequestId"/>
        <alias entity-alias="SI" name="status" field="description"/>
        <!-- this field value will replaced in CaseLookupService, I
just want a field to contain the updated value -->
        <alias entity-alias="SI" name="updated" field="statusCode"/>
        <alias entity-alias="CRT" name="custRequestType" field="description"/>
        <alias entity-alias="CRC" name="reason" field="description"/>
        <alias entity-alias="CRR" name="partyId"/>
        <alias entity-alias="CRR" name="roleTypeId"/>
        <alias entity-alias="PR" name="partyIdTo"/>
        <alias entity-alias="PR" name="partyIdFrom"/>
        <alias entity-alias="PR" name="roleTypeIdFrom"/>
        <alias entity-alias="PR" name="fromDate"/>
        <alias entity-alias="PR" name="thruDate"/>
        <alias entity-alias="PRDS" name="groupName"/>
        <alias entity-alias="CRA" name="attrName"/>
        <alias entity-alias="CRA" name="attrValue" field="teamPartyId"/>

        <view-link entity-alias="CR" rel-entity-alias="SI" rel-optional="true">
            <key-map field-name="statusId" rel-field-name="statusId"/>
        </view-link>
        <view-link entity-alias="CR" rel-entity-alias="CRT" rel-optional="true">
            <key-map field-name="custRequestTypeId"
rel-field-name="custRequestTypeId"/>
        </view-link>
        <view-link entity-alias="CR" rel-entity-alias="CRC" rel-optional="true">
            <key-map field-name="custRequestCategoryId"
rel-field-name="custRequestCategoryId"/>
        </view-link>
        <view-link entity-alias="CR" rel-entity-alias="CRR">
            <key-map field-name="custRequestId"/>
        </view-link>
        <view-link entity-alias="CRR" rel-entity-alias="PR" rel-optional="true">
            <key-map field-name="partyId" rel-field-name="partyIdFrom"/>
        </view-link>
        <view-link entity-alias="PR" rel-entity-alias="PRDS"
rel-optional="true">
            <key-map field-name="partyIdFrom" rel-field-name="partyId"/>
        </view-link>
<view-link entity-alias="CR" rel-entity-alias="CRA" rel-optional="true">
            <key-map field-name="custRequestId" rel-field-name="custRequestId"/>
<key-map field-name="?" rel-field-name="?"/>
        </view-link>


    </view-entity>




On Thu, Feb 24, 2011 at 9:46 AM, Justin Robinson
<[hidden email]> wrote:

> Ok my last email to the mailing list was rather glib, no suprise
> no-one replied. (Sorry)
>
> I need to define a view entity that can encapsulates the person-party
> (of type customer) related to party-group (of type account team) & the
> person-party (of type employee).
> So that I can trace the relationships  person-parties (of type
> customer) to the person-party (of type employee) through the common
> party of party-group (of type account team).
>
> I know it will involve one to many relationships, but I can't quite
> viualize how to define the view entity.
> After looking at 'The Big Book of OFBiz Diagrams' Detail Party:General
> Entities am not sure which entities need to be joined in the view to
> get this done.
>
> Can anyone shed some light about how to do about this?
> Thanks in advance.
>
> --
> Regards,
> Justin
> Venture-Net Research & Development
>



--
Regards,
Justin
Venture-Net Research & Development