cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Project Workflow

Former Member
0 Kudos

Hello Experts,

I am facing a strange issue dealing with Workflows in Projects. I have created a workflow definition, linked it to a phase and linked the phase configuration to a project document type.

All the pre-requisite configurations like configuring the Process Owner, associating the required security profiles etc are done.

Strangely, the workflow is not triggered during the phase change. I have rechecked all the configurations and it seems fine.

I have a feeling this issue might be related to the process owner profile but I cannot pin point the problem.

Any help/pointers would be highly appreciated. 

Note: We are on CLM 9.0 SP5.

Thanks,

Arijeet

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Experts,

We have managed to resolve the issue. Finally, we had to upgrade the patch level on SP05. The patch level we were on had issues related to workflows.

Thanks,

Arijeet

0 Kudos

Hello Arijeet

Glad that this is now resolved !

Regards

Sara Noy

Former Member
0 Kudos

Thanks Sara. We havetested the scenario in the DEV environment and it works perfectly. Will be transporting to QAS today.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Check the workflow:

- Is the workflow Active

- are there any start conditions in start events

- is start event Active

- are the other workflows running wıthout problem

- check event receivers with swue

REZA ROSTAMI - SAPHIRAN.COM - رضا رستمی

Former Member
0 Kudos

Hi Arijeet,

As per my understanding, you have followed all steps correctly. But this issue might occur when the workflow pre-script or post-script have some code mismatch. Pls re-check the scripts in workflow and try.

And also let me know whether the document is getting locked or not?

Regards,

Vignesh

Former Member
0 Kudos

Hi Vigneshwar,

The pre-script and post-script are without any errors/mismatch. The issue is that the document is not getting locked. I am assuming the process owner is unable to carry the work item to the approval phase due to which it is unbale to lock the document. Just to be sure I am pasting the prescript and postscript code below for your reference.

Prescript:

import com.sap.odp.api.doc.collaboration .*;
import com.sap.odp.api.usermgmt.masterdata.*;
import com.sap.odp.api.ibean .*;
import com.sap.eso.api.projects.*;
import java.util.*;
import java.math.*;
import java.String.*;

//Get List of collaborators from Project
collab = doc.getCollaborators();
iter = collab.iterator();

while(iter.hasNext()){
member = iter.next();

if(member.getCollaboratorRole().getDisplayName().toUpperCase().endsWith("APPROVER"))
addApprover(member.getPrincipal());
}

Postscript:

import com.sap.odp.api.doc.collaboration.*;
import com.sap.odp.api.doccommon.masterdata.*;
import com.sap.eso.api.projects.*;
import com.sap.odp.api.ibean.IBeanHomeLocator.*;
import com.sap.odp.api.doc.IapiDocumentLockManager.*;
import com.sap.odp.api.common.types.*;
import com.sap.odp.api.usermgmt.masterdata.*;
import com.sap.odp.api.workflow.*;
import java.math.*;
import com.sap.odp.api.common.types.TypeFactory.*;


if(getApprovalStatus() != APPROVED){
home = doc.getIBeanHomeIfc();
home.upgradeToEdit(doc);
home.changePhase(doc,"Business Need");

IapiDocumentLockManager.unlockDocument(session,doc);
}

if(getApprovalStatus() == APPROVED){

home = doc.getIBeanHomeIfc();
home.upgradeToEdit(doc);
home.changePhase(doc,"Market Analysis");

IapiDocumentLockManager.unlockDocument(session,doc);
}

It would be great if you could check the above code.

Thanks,

Arijeet

Former Member
0 Kudos

Hi Arijeet,

As per my understanding the collaborator with APPROVER role has to approve the document. If yes then your presript is correct. Try to give a static value(use .equals() instead of .endsWith()) and check whether the document is getting locked or not. Try with this prescript code

collaboratorsCollection = doc.getCollectionMetadata("COLLABORATORS").get(doc);//to get collborators collection

iter = collaboratorsCollection.iterator(); 

while(iter.hasNext()){
member = iter.next();

if(member.getCollaboratorRole().getDisplayName().toUpperCase().equals("APPROVER"))
addApprover(member.getPrincipal());
}

Regards,

Vignesh

Former Member
0 Kudos

Hi Vigesh,

Thank you for your response. Yes, you are correct in understanding that the script picks up a single collaborator with role Approver. I will try the code changes and get back to you. Just wanted to check whther I am using the correct verison of TWE editor. I have used version 2.1.1 to design the XPDL's.

Do you think I need a higher version?

Thanks,

Arijeet

Former Member
0 Kudos

Hi Vignesh,

I tried the code chages suggested by you but no luck. For some reason the workflow is not getting triggered.

I guess it is some other reason and not the code logic because of which it is not triggered. Let me know your thoughts.

Thanks,

Arijeet

rcr_tx
Advisor
Advisor
0 Kudos

Are you seeing an approver being inserted into the collaborators box?  If the WF can't find an approver in the collaborator section, it will bypass the WF as approved.

Former Member
0 Kudos

Hi Randy,

I have made sure that the approver is added to the collaborator section but no luck. The workflow still doesn't trigger.

Could this have to do something with security profiles?

Thanks,

Arijeet