Leveraging Workflow Approval status in Word document

I am using SharePoint 2013 and have created an Approval workflow that works as expected.
I would like to leverage the Approval Status within the document so that if someone views or prints the document, it will show "Pending" or "Approved" depending on where in the approval process the document is.
Once final approval has been made, I would also like to display within the document (e.g. cover page) the name of the approver, the date the approval occurred.
Would I have to use a Lookup column and point that to something?

Hi,
According to you description, my understanding is that you want to create an approval workflow which is able to set the status and approved time and the approver in the document.
Per my knowledge, there is no OOTB way to achieve your request. As a workaround, you can set this in document library. If someone views the document library, it will show the status and approved time and the approver in the document.
You could create a workflow using SharePoint 2010 platform in SharePoint  2013 Designer:
Create a date column named “Date” and a person column named “Approver” and a Single line of text column named “MyStatus” default value is “Pending” in library.
In SharePoint Designer 2013 using SharePoint 2010 platform ,select “Start Approval Process” action, set the user.
Add action “set [Date field] to [Today]”, in Approval -> Change the behavior of the overall task process in Customization field -> in When the Task Process Completes field, shown as figure below.
Add action “set [Approver] to [Current Task:Assigned To]”, “set [MyStatus] to [Approved]”in Approval -> Change the behavior of a single task in Customization field -> in When a Task Completes field. The steps are similar as above.
Then you can show the library content type column value in document template via “Quick Parts”,  access library settings -> Advanced settings -> click Edit Template, in Insert tag -> Document Property -> insert column you want, shown as
figure below.
Thanks,
Dean Wang

Similar Messages

  • Custom report for Workflow approval status

    Hi Friends,
    For one of my custom workflow the client needs a custom report to know the approval status. This custom workflow will be a multilevel approval and they want to know the status based on the object key(document number) like who has approved it at what time, who else has to approve etc which standard workflow tables can be used for this? Please advice.

    >
    sapient wrote:
    > Solved as per Arghdip,Martin and Mike's Suggestions.
    Thanks for the update, but how is this possible if two of them are completely different solutions? 
    This is a tecnical forum, accuracy is key. The word "and" doesn't really work in the above statement.

  • How to find the approval status for a document version

    Hi all,
    We have enabled versioning on a folder and the system is maintaining the versions. I need to be able to identify which version in at what status.
    For example, I create a file and it creates a version, I check it in and out several times, I then release/publish the file, and another version is created, I then check it out and in several times and the cycle begins again.
    I then realize that I need to go back to the latest released version but I don't know which one it is nor can I identify it using the 'versions' selection from details. How do I know what the status is of the previous versions?
    I need to be able to identify only those versions, past and present, that were 'approved/released' vs those that were left in progress. How do I find the statuses of the previous versions to correctly identify which version was released.
    KM is maintaining this some how because it knows to show only those items that are released to the standard user and not show them those that are in progress.
    How do I find that same parameter that shows me which older version is release?
    I am looking for something like what is available with the properties selection on the 'versions' screen. I am able to go to any version and look at the properties of that version at the time the version was saved. This is what I need with status. I need to be able to look at any version and know what status was at the time it was saved.
    Any help is appreciated,
    Srini

    Hi
    According to my knowledge,Versioning can only be done on files, not folders.
    To view the version history of a file, as well as save prior revisions to another location to view them do this:
           1.      Using Windows Explorer, locate the file.
           2.      Right-click the file and select Versioning and then select List Version History.
    The resulting dialog displays the version history of this file.
           3.      Select a prior version and click the Save As button to save the version to another location.
    Regards
    Elizabeth

  • Workflow Error Message: System Account - The Workflow could not set Content Approval Status

    This is the first time I try an approval workflow. I am using a template in MS Word and assigned an approval workflow to it. The approval workflow is only going to one person in this case.
    When I start the work flow the following 3 error messages show up:
    Workflow Error Message: System Account - The Workflow could not set Content Approval Status. Enable content moderation for this list and run the workflow again.
    Workflow Error Message: System Account - The e-mail message cannot be sent. Make sure the e-mail has a valid recipient.
    Workflow Error Message: System Account - The e-mail message cannot be sent. Make sure the outgoing e-mail settings for the server are configured correctly.
    Thank you for your kind guidance.

    Hi,
    For the first error: Did you set Content Approval in the workflow?  If so, see if you have it in the versioning settings of the list settings.
    For the second error: double check your recipient is set up as being valid.  Did you type in the email address or is it referring to a people picker field?  also, make sure that in the workflow for the email that you actually populated it in the
    To: field.
    for the third error: I suspect that either your farm is not configured for email.  Or, this error is a knock on from the second error.  If you get the second error rectified it may clear this error.  If not then double check the email settings
    for your farm.
    Johnathan Lightfoot

  • SP2010 Designer workflow "Set Content Approval Status" does not work

    Hello
    I'm having a problem with a workflow for one of my clients.It is a SharePoint 2010 environment and I can only use SharePoint 2010 designer (no visual studio).
    We have an approval workflow in place, which works great. After the document approval workflow has does its thing, a new workflow can be launged by specific users (they have writing rights and can approve content). The workflow is used to set the release
    date of the document. This can only be determined after content approval.
    However, when the release date is set, the document approval status is changed to concept. This is of course to be expected, as we changed to document metadata. That is why I wanted to add the action "Set content approval" to this workflow. I cannot
    seem to get this action to work. Right now the workflow does the following:
    check out the document (check out is obligatory in our library)
    set the release date field to the released date parameter (defined when starting the workflow)
    check in the document
    set content approval to approved.
    The release date gets set to the parameter value, but the document is not checked in and the content approval status is not set. SharePoint produces the following error message (translated from Dutch): "An error occured. Cannot edit the item, possibly
    because one or more columns require another type of content. Unknown error."
    Guided by other posts online I gathered that this might be because the actions checkin and set content approval occur to close together. I tried letting the workflow pause for the duration of 1 minute after checking in, but this pauses the workflow indefinitely.
    I then tried 5 minutes (as this is the time standard set by SP2010 designer) but this also resulted in indefinite pausing.
    Posts online lead me to believe that I'm not the only suffering from this problem, but as of yet, I haven't been able to find a solution that works for me. Hopefully someone can help me.

    Hi,
    According to your post, my understanding is that the "Set Content Approval Status" didn’t work in SharePoint 2010 Designer workflow.
    I try to reproduce the issue and the result is the same as yours.
    If I only check out and check in the item, the workflow works well.
    However, once I set Content Approval Status after checking in the item, the workflow get error.
    As a workaround, I recommend to use two workflow to achieve what you want.
    First, create the first workflow, and allow the workflow to be manually started.
    Then, create the second workflow, and
    start the workflow automatically when an item is changed.
    When you start the first workflow, the document will be set value of the release date. And then the second workflow will be started automatically to set the content approval status.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • PO workflow showing status as APPROVED.. but in Oracle status is"IN PROCESS

    In Our 11i , one of the PO workflow showing status as APPROVED.. but in Oracle Still showing the status as "IN PROCESS".. could you Please suggest solution...?

    Hi,
    What is the application release?
    Please see if these docs help.
    Troubleshooting Purchasing Approval for Documents in "IN PROCESS" or "Pre-Approved" Status [ID 225017.1]
    How To Diagnose An Issue In Requester Change Order Processing [ID 453551.1]      
    How To Reset a Document From In Process or Pre-Approved To Incomplete/Requires Reapproval For Isolated Cases [ID 390023.1]
    Thanks,
    Hussein

  • Can't retrieve approval status in Globally Reusable Workflow (Approval - Sharepoint 2010)

    For day's i am trying to implement the following in one of the standard, out of the box, Globally Reusable Workflow with Sharepoint Designer 2010:
    If Current Item:Approval Status not equals 0:#Approved Start Approval Workflow Task process on Current Item with Parameter:Approvers Else //Nothing
    This is to prevent that a workflow is started if the item is already approved! The strange thing is, a buddy of mine has also Sharepoint 2010 and he can select in the DropDown list -Current Item: -> Approval Status..
    But the only things I can select are the following:
    Content Type
    Created By
    ID
    Modified
    Modified By
    Title
    I don't understand what is going wrong! What am i forgetting to configure or bind or set?

    I have found the solution!
    I have setup an test environment, Sharepoint 2013 on MS Server 2008R2 and installed Sharepoint Designer 2013. When I now edit the default out of the box "Approval - Sharepoint 2010", if you enter the condition "if current item field equals value", you can
    now select "Approval Status"!!
    So this means that it IS available after all! After a lot of trying, searching, this is the solution in a Sharepoint 2010 environment, installed on MS Server 2008R2:
    Edit the (global or copied version if you want) workflow.
    Add the condition "if current item field equals value" as a step.
    Select from the item field: Content Type
    Click on "equals" and change it to "not equals"
    Then click on the condition and enter manually the following: 0;#Approved
    Move the task "Start Approval Workflow Task..." up so it is a part of the condition "If.. "
    Add an Else condition
    Enter here your custom action or log to show the user that the Task is not performed.
    Save the workflow.
    We now have to manually edit the Workflow Rules file.
    In Sharepoint Designer 2010, click at the left side of the ribbon on "All Files".
    If you have created a custom workflow, you can find the "Workflow.xoml.rules" file, in the folder
    Workflows/"Your custom workflow"/"CustomWorkflow.xoml.rules".
    If you are using the global, out of the box Workflow, you can find the .rules file in:
    _catalogs/wfpub/Approval - SharePoint 2010/ReviewApproval_1033.xoml.rules
    Click on the file, then in the next screen click on "Edit file" under Customization. 4.Search for the string "ContentType" 5.When you have found the string, it looks a bit like this:
    ns1:String xmlns:ns1="clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">ContentType ns1:String
    (When you look a few lines below this line, you see your added condition 0;#Approved)!
    6.Replace the string ContentType with: _ModerationStatus 7.Save the file! 8.Open in the current directory the "Workflow.xoml" file (this is the workflow itself) 9. Click on the Save button, it will give you a notice:
    A more recent version of _catalogs/wfpub/Approval - SharePoint 2010/ReviewApproval_1033.xoml.rules has been saved to the server by "user" on 1/5/2014 10:50 AM.
    Do you want to replace this with your file?
    Click NO! (Important, otherwise it will replace it with the default rules file, and nothing has changed!)
    Close Sharepoint Designer 2010, reopen SPD2010 and go to the workflow.
    Edit the workflow and you'll see the following now:
    "If Current Item: equals 0;#Approved"
    The field Content Type is now gone! This is correct so don't worry!
    Publish the workflow and you are done!
    Check now on a library that has a link to the edited workflow, when you start a new Workflow on a Approved-Major version of the document, what the outcome is:
    The workflow is discarded because of the condition and nothing happened, so your document stays on the most recent Approved-Major version and is not published back to a previous version number!!
    Conclusion: I think that the Sharepoint 2010 Designer, is missing that specific "Approval Status" field, but with the solution i have just given, you can solve this!
    C# for the win!

  • Approval Workflow does not update the Content Approval status if started automatically

    Hi,
    I’m using a simple Approval Workflow associated with
    Content Approval on site pages. It works fine when I set it to be started manually (by using
    Allow this workflow to be manually started by an authenticated user with Edit Item permissions
     option) and on the completion of the workflow the
    Content Approval status is updated accordingly. But when I set it to be started automatically (by using
    Start this workflow when a new item is created
     / Start this workflow when an item is changed
    options), it does not updates the Content Approval status. Note that I’ve set the
    Update the approval status after the workflow is completed (use this workflow to control content approval)
    option to true.
    Regards

    Hello,
    It is recommended to select "Start this workflow to approve publishing a major version of an item" when you want to use the workflow to manage content approval for
    a library.
    According to the Notes for “Enable Content Approval” option in
    this reference:
    If you are using this Approval workflow to manage content approval (moderation) for a library, and you selected the Start this workflow to approve publishing a major version
    of an item check box on the Add a Workflow page..
    If you did not select the Start this workflow to approve publishing a major version of an item check box on the Add a Workflow page because you do not want this workflow to
    be the default content approval workflow for a library, you can select the Update the approval status (use this workflow to control content approval) check box to make this workflow a secondary content approval workflow that specific users can
    start manually.
    That means having an approval workflow start automatically when a document is changed or created is not a good practice when you want to use the workflow to manage
    content approval for a library. You should either select "Start this workflow to approve publishing a major version of an item" or give users the option to start the workflow manually at the time they want to submit for an approval.
    Thanks & Regards.
    Lily Wu

  • Workflow Approval on Material Document

    Hallo,
    My client requires approval workflow on good receipts.
    I would like to share my vision and check with you feasibility or alternatives.
    I was thinking to exploit the 'Hold' status, as follow:
    1) go to MIGO, input data, put the document on hold
    2) start an approval workflow.
    3) when workflow ends, create the material document.
    Issue is on the business Object, as cannot use MKPF, as the Document on hold status does not get a document number yet.
    I have found that 'Held' document are stored in table MMIM_PREDOC_ORG,
    I was thinking to create an ZBusiness Object based on the key of table MMIM_PREDOC_ORG, and there create all the relevant methods.
    Still I have not figured out how can the approval can be performed technically. (no approve or release button on MIGO)
    Would you say this is a viable solution?
    Please let me have your feedback.
    Best Regards,
    Marco

    Either you create a module pool that looks like the MIGO Tcode with some button or you use a decisiontask with some options.
    Thanks
    Arghadip

  • How do I show the Status file property of a Word document in the SharePoint library?

    When I created some Word documents (using Word 2010) I filled in the Status property before saving them on my PC's local hard drive. Not having tried that before, I verified I'd done it by selecting the file in Windows 7 File Explorer and looking at
    the file properties pane along the bottom of window. Lo and behold, there's a line in there called Content Status with a value identical to what I typed in within Word.
    So far so good. But how do I get the SharePoint library to show the value of that field for each document? I tried Modify This View (go to the library, click ... , Click Modify This View) then looking at the list of columns I can enable / disable using the
    Display tick boxes. But neither Status or Content Status are listed among the 21 Column Names and there doesn't seem to be a control to add custom ones.
    Have I missed out some stage? What am I doing wrong?
    Please keep in mind that I'm a SharePoint novice.
    Regards,
    Bruce Officer

    Hi ,
    Do you want to change the default paper size in Word 2010? If so, this is how I do it.
    1. In Word 2010, go to Page layout tab.
    2. Click Size in the Page Setup group then click More Paper Sizes.
    3. In the Paper tab, input the paper size that you want, then click Set as default.
    If there is anything that I can do for you regarding this issue, feel free to post back.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Convert word document in PDF,e pub,by using third party dll in Sharepoint designer workflow 2013?

    Hi,
    I want to convert word document to PDF,  EPub, by using third party (.dll).
    In SharePoint designer workflow in 2013.
    So that I have question, Can we Install third party (.dll) in SharePoint workflow Designer for conversion?
    Means I have created one simple application conversion of word to e Pub, PDF, Image by using (Spire.doc dll) in Visual Studio.
    So this same conversion I want to work in SharePoint designer workflows?
    So anybody has any solution then please provide me.
    Thanks,
    Samadhan

    it might be worth looking at these CodePlex steps, that plug directly into the Word Automation Services.
    http://sp2010wordautomation.codeplex.com/
    It'll provide you with a configurable step like the below that should help you achieve your aims
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Approval Status of all the documents which were in 'Approved' state, now showing as 'on going' status after migration to SP 2010.

    Hi There,
    I have recently migrated my SharePoint 2007 portal to SP2010, However, to my surprise  i have noticed all the documents in different document libraries are having 'Approval status' as 'On going' status which suppose to be 'Approved' status.
    I mean, before migration all the documents status was 'Approved' and after migration it is showing as 'on going'.
    This is absolutely incorrect, can someone help in this.
    How can i retain all the documents status as 'Approved'
    Regards
    Vikram P
    vikram padigala

    Hi There,
    I have recently migrated my SharePoint 2007 portal to SP2010, However, to my surprise  i have noticed all the documents in different document libraries are having 'Approval status' as 'On going' status which suppose to be 'Approved' status.
    I mean, before migration all the documents status was 'Approved' and after migration it is showing as 'on going'.
    This is absolutely incorrect, can someone help in this.
    How can i retain all the documents status as 'Approved'
    Regards
    Vikram P
    vikram padigala

  • How to convert a word document to PDF from a criteria workflow

    Hi,
    How to create a new revision in PDF format from a word document inside a criteria workflow? The inbound refinery converts documents to PDF automatically upon check-in, but I want to make the conversion in a specific step of a workflow.
    Thanks,
    Miguel

    You could write a custom service and execute it within the workflow script using the executeService Idoc function.

  • OOTB Approval Workflow on Custom List does not Update Approval Status

    I have a custom list on which I've required content approval.  I then created a workflow instance from the "Approval - SharePoint 2010" template.  For this workflow I have selected "Update the approval status after the workflow
    is completed (use this workflow to control content approval".  When I approve the list item via the workflow task item the status of the item is not updated but stays at pending even though the
    workflow shows "Completed" with the Outcome of "approved".  Is this the expected behavior, i.e. does "Update the approval status after the workflow is completed (use this workflow to control content approval"
    not work for custom lists?  Does it work on any of the lists?

    Hi Kalos1840,
    If you check "Require Content Approval" setting, only the way above can update the approval status due to the approval status is for this approval workflow. As this approval workflow cannot achieve your demand, I recommend you un-check "Require Content Approval"
    setting and create a custom workflow such as the OOTB Approval Workflow or SharePoint Designer workflow.
    Here is the steps of a SharePoint Designer workflow:
    1.Go to your custom list , click Create a Workflow in SharePoint Designer.
    2.Add a “Start a task process” action in your workflow.
    3.Click “these users” and Start a Task Process edit page will pop up.
    4.In the Participants field, input your  approvers based on the order of approval.
    5.In the right of Participants field, select “Serial (one at a time)”.
    Best  Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to call workflow approve service in loop for multiple documents.

    i have created a serviceHandler for approving the document and i post the comma separated dIDs as a string from workflow approval template(custom template). And in serviceHandler program i pass the did for approving and only first document is approved and for other document its throwing error, Its showing error document revision is not a latest revision but document is having only one revision.
    my code is: can anyone help me.
    public void SendAllDocuments()
            throws DataException, ServiceException{
        try{
        String [] ContentDids;
        System.out.println("+++++++here we are the all SendAllDocuments++++++++++++++");
        String workflowIds = m_binder.getLocal("workflowIds");
        if(!workflowIds.isEmpty()){
             ContentDids = workflowIds.split("\\,");
        }else{
            throw new ServiceException("document are not selected from users, workflowIds"+workflowIds);
        int arrayLength = ContentDids.length;
        for(int iterator=0;iterator<=arrayLength-1;iterator++){
            SendDocumentToUserQueue(ContentDids[iterator]);
        }}catch(Exception e){ e.printStackTrace();}
        m_workspace.releaseConnection();
    //DocMeta table varible which are coming from Internal assignment page
    //xWF_SentFrom",xWorkflowStepAlias",xWF_SendTo",xPurposeForSubmission",xPurposeForRejection",xDocApproval",xWorkflowComments"
    //xInternalAssignment",togroup",xWF_SendToSend",xWF_SendToSend12",xPurposeForSubmissionSend",xWF_SendToApprove",wfSendApproveComments"
    //Revision table variable which can get from getRevisionsTableValueFromDid
    // dDocName", dDocType",dRevLabel",dSecurityGroup",dDocAccount"
    public void SendDocumentToUserQueue(String approvalId) throws DataException, ServiceException{
        try{
            DataResultSet resultset =getRevisionsTableValueFromDid(approvalId);
            String sendToName = m_binder.getLocal("sendToName");
            String sender="takuma";
        //String workflowComments = m_binder.getLocal("workflowComments");
        String workflowReason = m_binder.getLocal("workflowReason");
        m_binder.putLocal("IdcService", "WORKFLOW_Approve");
        m_binder.putLocal("idcToken", m_binder.getLocal("idcToken"));
        m_binder.putLocal("dID", approvalId);
        m_binder.putLocal("xWF_SendTo", sendToName);
        m_binder.putLocal("xPurposeForSubmission","108");
        m_binder.putLocal("xWF_SentFrom", sender);
        m_binder.putLocal("xWorkflowStepAlias", "");
        m_binder.putLocal("xPurposeForRejection", "");
        m_binder.putLocal("xDocApproval", "");
        m_binder.putLocal("xWorkflowComments", "");
        m_binder.putLocal("xInternalAssignment", "");
        m_binder.putLocal("xWF_SendToSend", "");
        m_binder.putLocal("dDocName", getData(resultset,"dDocName"));
        m_binder.putLocal("dDocType", getData(resultset,"dDocType"));
        m_binder.putLocal("dRevLabel", getData(resultset,"dRevLabel"));
        m_binder.putLocal("dSecurityGroup", getData(resultset,"dSecurityGroup"));
        m_binder.putLocal("dDocAccount", getData(resultset,"dDocAccount"));
        executeService(m_binder, sender);
    }catch(Exception e){ e.printStackTrace();}
    public DataResultSet getRevisionsTableValueFromDid(String documentId) throws DataException, ServiceException{
        DataResultSet drs = new DataResultSet();
        try{
            /*String sqlDocType="select dDocType from revisions where dId ='"+documentId+"'";
        ResultSet documentRset = getSystemWorkspace().createResultSetSQL(sqlDocType);
        //handle null pointer exception for DocumentValue
        String DocumentValue = ResultSetUtils.getValue(documentRset, "dDocType");*/
        String sql="select dDocName,dDocType,dRevLabel,dSecurityGroup,dDocAccount from Revisions where dId ='"+documentId+"'";
        ResultSet rset = getSystemWorkspace().createResultSetSQL(sql);
        if (rset == null || rset.isEmpty()) {
            SystemUtils
                    .info("Resultset is null please check database query and Did ="+documentId);
        drs.copy(rset);
        catch(Exception e){
            System.out.println("in catch of getRevisionId Method");
            e.printStackTrace();}
        //handle null pointer exception for DocumentValue       
        return drs;       
    public String getData(DataResultSet dataSet, String value) {
        String fieldValue = "";
        fieldValue = ResultSetUtils.getValue(dataSet, value);
        System.out.println(fieldValue+"value is null in getData Method=======");
        return fieldValue;
    public UserData getFullUserData(String userName, ExecutionContext cxt,
            Workspace ws) throws DataException, ServiceException {
        if (ws == null)
            ws = getSystemWorkspace();
        UserData userData = UserStorage.retrieveUserDatabaseProfileDataFull(
                userName, ws, null, cxt, true, true);
        //ws.releaseConnection();
        return userData;
    public Workspace getSystemWorkspace() {
        Workspace workspace = null;
        Provider wsProvider = Providers.getProvider("SystemDatabase");
        if (wsProvider != null)
            workspace = (Workspace) wsProvider.getProvider();
        return workspace;
    public void executeService(DataBinder binder, String userName)
            throws DataException, ServiceException {
        // obtain a connection to the database
        Workspace workspace = getSystemWorkspace();
        // check for an IdcService value
        String cmd = binder.getLocal("IdcService");
        if (cmd == null)
            throw new DataException("!csIdcServiceMissing");
        // obtain the service definition
        ServiceData serviceData = ServiceManager.getFullService(cmd);
        if (serviceData == null)
            throw new DataException(LocaleUtils.encodeMessage(
                    "!csNoServiceDefined", null, cmd));
        // create the service object for this service
        Service service = ServiceManager.createService(serviceData.m_classID,
                workspace, null, binder, serviceData);
        // obtain the full user data for this user
        UserData fullUserData = getFullUserData(userName, service, workspace);
        service.setUserData(fullUserData);
        // binder.m_environment.put("REMOTE_USER", userName);
        ServiceException error = null;
        try {
            // init the service to not send HTML back
            service.setSendFlags(true, true);
            // create all the ServiceHandlers and implementors
            service.initDelegatedObjects();
            // do a security check
            service.globalSecurityCheck();
            // prepare for the service
            service.preActions();
            // execute the service
            service.doActions();
            // doany cleanup
            service.postActions();
            // store any new personalization data
            service.updateSubjectInformation(true);
            service.updateTopicInformation(binder);
        } catch (ServiceException e) {
            varTrueFalse = false;
            error = e;
            SystemUtils.info("exception in second location=" + e);
            e.printStackTrace();
        } finally {
            // Remove all the temp files.       
            service.cleanUp(true);       
        // handle any error
        if (error != null) {
            error.printStackTrace();
            if (binder.getLocal("StatusCode") == null) {
                binder.putLocal("StatusCode", String.valueOf(error.m_errorCode));
                binder.putLocal("StatusMessage", error.getMessage());
            } else {
                throw new ServiceException(error.m_errorCode,
                        error.getMessage());

    I guess it is caused by the fact that some of variables in the binder refer to the first workflow item. My bet would be dDocName.
    Try to find out what's in the binder if you approve the second item from GUI and what's there when you do it from your program. That should give you enough info what you need to change.

Maybe you are looking for