Skip to Content
author's profile photo Former Member
Former Member

Question about creating Contract Document workflow

Hi experts,

I have started to create the first workflow for the Contract Document. I have a lot of questions in mind and i think you guys can help me to clarify those question. Please see the following question.

1. When i created a new Phase Defination for Contract Document, i have seen 2 phases which can not be remove ('Draft' and 'Excuted'). I understand that those phases are the madatory phase for Contract Document, when a contract is created and saved for 1st time it will be automatically moved to 'Draft' or i need to write the script to change the phase to 'Draft'. When everythings done('approved') it should be moved to 'Excecuted'. Am i correct?

2. I'd like to add the approver in the Collaborators collection. for example i'd like to add 'noppong.j' (user id) as approver in the Collaborators,. which api do i have to use to look up the user object and add it to Collaborators collection.

3. I'm using TWE 2.2-1 to create XPDL. Does the participant in the TWE tool have to be the same as the approver in the script.In other word the participant in TWE is 'Approver', but i add 'noppong.j' as the approver in the preScript. Is in work?


Thank you in advance

Edited by: Noppong Jinbunluphol on Nov 2, 2011 11:19 AM

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 02, 2011 at 10:41 AM


    1. As you said Draft and Executed are the default mandatory phases and a contract document is always created & saved in draft phase. You need not incorporate additional logic to achieve this. Executed phase is the final phase iteration once all the approvals are complete.

    2. Following methods can be used in prescript to add approvers:

    addApprover(principal) : Adds the specified principal to the list of approvers. The principal must be an object reference to a group or a user.

    addApprover(principal, rule): Overloaded variant of the previous method. The addition of rule controls whether all approvers must approve or any of the approvers can approve the activity

    You can further look into threads wherein you would find multiple examples of usage of these methods


    Mudit Saini

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thank you so much Mudit,

      Your post is useful for me to start creating the first workflow. Do you have link or blog to share about the Scripting and Workflow, i think the document from SAP is not enough for complicated case.

      Thanks you,