Programmatically create phases

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

Programmatically create phases

tiffanymlk
Hi,

I would like to programmatically add the same phases whenever a project is created. Has anyone every tried to do such a thing?


I inserted the following code in the 'createProject' method of the ProjectServices.xml files.
<if-empty field="parameters.templateId">
         <set field="createProjectPhase.workEffortName" value="Phase1"/>
            <set field="createProjectPhase.workEffortParentId" from-field="parameters.projectId"/>
         <call-simple-method method-name="createProjectPhase"/>
        </if-empty>


And this is the 'createProjectPhase' method:
 <simple-method method-name="createProjectPhase" short-description="Create a project phase and optionally assign">
       
        <if-empty field="parameters.statusId">
            <set field="parameters.statusId" value="PTS_CREATED"/>
        </if-empty>
        <call-simple-method method-name="createWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/>
        <set field="parameters.workEffortId" from-field="newEntity.workEffortId"/>
       
        <if-not-empty field="parameters.partyId">
            <call-simple-method method-name="assignPartyToWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/>
        </if-not-empty>
       
        <if-not-empty field="parameters.estimatedHours">
            <set field="parameters.estimatedDuration" from-field="parameters.estimatedHours" type="Double"/>
            <if-empty field="parameters.skillTypeId">
                <set field="parameters.skillTypeId" value="_NA_"/>
            </if-empty>
            <call-simple-method method-name="createWorkEffortSkillStandard" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/>
        </if-not-empty>
    </simple-method>

Any help would be much appreciated, thanks

steph.
Reply | Threaded
Open this post in threaded view
|

Re: Programmatically create phases

Jacques Le Roux
Administrator
Please use rather user ML for such questions, see why here :
http://cwiki.apache.org/confluence/display/OFBADMIN/Mailing+Lists#MailingLists-DesignanddevelopmentList:dev@...

Moreover you should get more answers there

Thanks

Jacques

From: "tiffanymlk" <[hidden email]>

> Hi,
>
> I would like to programmatically add the same phases whenever a project is
> created. Has anyone every tried to do such a thing?
> I inserted the following code in the 'createProject' method of the
> ProjectServices.xml files.
> <if-empty field="parameters.templateId">
>         <set field="createProjectPhase.workEffortName" value="Phase1"/>
>            <set field="createProjectPhase.workEffortParentId"
> from-field="parameters.projectId"/>
>         <call-simple-method method-name="createProjectPhase"/>
>        </if-empty>
>
> Any help would be much appreciated, thanks
>
> steph.
> --
> View this message in context: http://n4.nabble.com/Programmatically-create-phases-tp1697334p1697334.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>