cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot Submit for approval

former_member188556
Active Contributor
0 Kudos
84

Hi,

I have written an WDP Application which creates a resource in KM and subsequently <b>"Submits it for approval".</b>

Now the problem is, all the users can create the content, but only user having a <b>Content Management</b> role can perform the submit for approval action. I have given the content admin the application role. We can see the resource getting created in the KM folder for all the users. But only Content admin can submit.

I have given all the reqd. users the full control over the folders.

Now what could be the problem???!!!!!

Helpful answers will be rewarded

Thanks in advance

BP

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

This link explains all you need to know about approval process: prerequisites, service permissions, process workflow and

Publishing with an Approval Process.

http://help.sap.com/saphelp_nw2004s/helpdata/en/04/9053ad76fd0948b4ec2abf97898a3e/frameset.htm

Patricio

former_member188556
Active Contributor
0 Kudos

Hi Patricio

I followed thru this link and heve already setup all the permissions and all.

But the problem is that only some users can submit the resource into workflow, wheras some others cant.

It behaves strangely.

I am putting the code below which i am using to approve the resource.

IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
IUser sapUser = wdClientUser.getSAPUser();
com.sapportals.portal.security.usermanagement.IUser ep5User =
         WPUMFactory.getUserFactory().getEP5User(sapUser);
IResourceContext resourseContext = new ResourceContext(ep5User);
RID pathRID = RID.getRID("/documents/abc/" + fileName);
IResourceFactory resourseFactory = ResourceFactory.getInstance();
IResource resource =	(IResource) resourseFactory.getResource (pathRID,                resourseContext);
		IRepositoryServiceFactory factory =
			ResourceFactory.getInstance().getServiceFactory();

		IStatemanagementManager statemanagement =
			(IStatemanagementManager) factory.getRepositoryService(
				resource,
				IWcmConst.STATEMANAGEMENT_SERVICE);

		IStatemanagementResource sResource =
			statemanagement.getStatemangementResource(resource);

		IResourceTransition transition = sResource.getTransition("lbl.submit");

		IResourceTransitionList transList = sResource.getAllowedTransitions();

		
		

		if (transition != null)
		{
		
			transition.execute();
		}
		
	}

Now i am getting catching all the exceptions in this code.

But nothing is getting thrown up.

Checked the AllowedTransitions list for the logged in user also, which gives me positive result.

But some users simply cant submit the resource.

BP

detlev_beutner
Active Contributor
0 Kudos

Hi BP,

Please double-check all settings and values returned from this thread: https://forums.sdn.sap.com/thread.jspa?threadID=240311 - and if this is not working immediately, please get back with detailed results (what did you try, which return values did you have etc).

Hope it helps

Detlev

former_member188556
Active Contributor
0 Kudos

Hi Detlev,

I used

IResourceTransitionList transList = sResource.getAllowedTransitions();

to get the allowed transitions for the particular user. It is giving me results as <b>lbl.submit lbl.skip.inprogress</b>. Now as

<b>if (transition != null)

{

transition.execute();

}</b>, this code is also working without any exception.

But when u go to the folder in km and check its status, it will be in ""<b>in progress</b> state only.

In the application i am creating the resource first then i am submiting it for workflow. It happens in a single button press.

My NWDS version is 2.0.15 and portal version is ep6 sp17.

Regards

BP

detlev_beutner
Active Contributor
0 Kudos

Hi BP,

Once again: Please follow Romano's steps in the given thread and come back with the detailed results (trans.execute() -> boolean -> is OK?; trans.getExecMessage() -> any msg?; defaultTrace -> nothing?)

Save our and your time <i>reading</i> the answers and following them...

Hope it helps

Detlev

Former Member
0 Kudos

> But when u go to the folder in km and check its status, it will be in <b>in progress</b> state only.

When you submit a resource for approval, its state will be <b>in progress</b>. What status are you looking for instead? If you check the status of the resource after your code submits it for approval, and the status is <b>in progress</b>, sounds like it's working correctly to me..

detlev_beutner
Active Contributor
0 Kudos

Hi Fallon,

No, a resource before being submitted for approval has state "In progress", whereas a resouce submitted for approval has state "Awaiting approval".

Best regards

Detlev

former_member188556
Active Contributor
0 Kudos

Hi Detlev

This is d code that i used from Romano's forum reply


if (transition != null)
		{
			boolean b = transition.isAllowed();
			boolean b1 = transition.execute();
			String strMsg = transition.getExecMessage();
			tr=" "+b+" "+b1+strMsg;
			return tr;
		}

And i got this message on printing tr

<b>true falseAn error occurred in the approval process. Check the workflow.</b>

And thus the resource remains in "<b>In Progress</b>" state

I am getting positive results for some users who share the same permission level to the folder.

Default trace i will post asap as it has to be mailed from my sys admin from onsite location.

Please advice

Thanks in advance

BP

detlev_beutner
Active Contributor
0 Kudos

Hi BP,

OK, we are getting closer. Anyhow, without the default trace, I really cannot say what could be the reason for this.

Best regards

Detlev

Former Member
0 Kudos

Hi,

We had to write this code. It's a button that allow you to submit a document and change acl permission.

Patricio.

public IRenderingEvent execute(IResource res, Event event) throws WcmException {

if (event instanceof ConfirmEvent) {

String pepe = "";

ConfirmEvent cce = (ConfirmEvent) event;

pepe += " a1 ";

if (ConfirmEvent.CHOICE_YES.equals(cce.getChoice())) {

IRepositoryServiceFactory repositoryServiceFactory = ResourceFactory.getInstance().getServiceFactory();

IStatemanagementManager statemanagementManager =

(IStatemanagementManager) repositoryServiceFactory.getRepositoryService(res, IWcmConst.STATEMANAGEMENT_SERVICE);

IStatemanagementResource sResource = statemanagementManager.getStatemangementResource(res);

IResourceTransition resourceTransition = sResource.getTransition("lbl.submit");

if (resourceTransition != null) {

resourceTransition.execute();

}

try {

ISecurityManager sm = res.getRepositoryManager().getSecurityManager(res);

pepe += " a7 ";

if (sm != null && sm instanceof IAclSecurityManager) {

IAclSecurityManager asm = (IAclSecurityManager) sm;

IResourceAclManager ram = asm.getAclManager();

IResourceAcl ra = ram.getAcl(res);

if (ra == null) {

IUMPrincipal administradores = WPUMFactory.getGroupFactory().getGroup("Loyal ISO Administrador");

IUMPrincipal publicadores = WPUMFactory.getGroupFactory().getGroup("Loyal ISO Publicador");

ra = ram.createAcl(res);

ra.addOwner(administradores);

ra.addOwner(publicadores);

}

IUMPrincipal everyone = WPUMFactory.getGroupFactory().getGroup("Everyone");

IResourceAclEntryList rel = ra.getEntries();

IResourceAclEntryListIterator it = rel.iterator();

while (it.hasNext()) {

IResourceAclEntry entry = it.next();

if (entry.getPrincipal().equals(everyone)) {

ra.removeEntry(entry);

}

}

}

} catch (AclPersistenceException e) {

return new InfoEvent(Status.ERROR, "Error en el cambio de permisos");

} catch (ResourceException e) {

System.out.println("I raised a ResourceException " + e.getMessage());

return new InfoEvent(Status.ERROR, "Error en el recurso");

} catch (UserManagementException e) {

System.out.println("I raised a UserManagementException" + e.getMessage());

return new InfoEvent(Status.ERROR, "Error en el manejo de usuarios");

}

return new InfoEvent(Status.OK, "Done !");

} else if (ConfirmEvent.CHOICE_NO.equals(cce.getChoice())) {

return ConfirmComponent.onNo(event, res.getContext().getLocale());

} else if (ConfirmEvent.CHOICE_CANCEL.equals(cce.getChoice())) {

return ConfirmComponent.onCancel(event, res.getContext().getLocale());

}

}

return new InfoEvent(Status.ABORT, "Aborted.");

}

former_member188556
Active Contributor
0 Kudos

Hi Patricio,

Can you let me know what we are achieving here?

Is it like we r adding two more groups to the folder?

Regards

BP

Answers (1)

Answers (1)

0 Kudos

Hi,

Did you check the if the Service Permissions are set to <b>Full Access</b>

http://help.sap.com/saphelp_nw2004s/helpdata/en/8b/764d3c006f8f0ce10000000a11405a/frameset.htm

Greetings,

Praveen Gudapati

p.s. Points are always welcome for helpful answers

former_member188556
Active Contributor
0 Kudos

Hi Praveen.

THe service permissions are set to full control for all the users.

Still the same result

BP