Skip to main content
1-Visitor
January 14, 2016
Question

How to modify promotion notice team correct

  • January 14, 2016
  • 1 reply
  • 3013 views

Hi!

I modify team of the promotion notice by code. But inside the workflow promotion notice team have the default value. What can be wrong?

1 reply

1-Visitor
January 18, 2016

I have re-used the code mentioned in https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS31366  many times and it works good.

Thank you

Binesh Kumar

1-Visitor
January 20, 2016

Hi Binesh!

I can describe my work:

I' ve modified Promotion notice (PN) creation process. PN creation wizard call the doOperation() method of my own FormProcessor class that extend CreateObjectFormProcessor class.

public class CreatePRFormProcessor extends CreateObjectFormProcessor

{

  @Override

  public FormResult doOperation(NmCommandBean paramNmCommandBean, List<ObjectBean> paramList) throws WTException

  {

  FormResult localFormResult = new FormResult();

  localFormResult.setStatus(FormProcessingStatus.SUCCESS);

  if (paramList.size() > 0)

  {

  localFormResult = super.doOperation(paramNmCommandBean, paramList);

  if (!continueProcessing(localFormResult))

  {

  return localFormResult;

  }

  for (ObjectBean localObjectBean : paramList)

  {

  if ((localObjectBean.getObject() != null) && ((localObjectBean.getObject() instanceof Persistable)))

  {

  Persistable pobj = (Persistable)localObjectBean.getObject();

  WorkflowHelper.setPR(pobj, paramNmCommandBean);

  }

  }

  }

  return localFormResult;

  }

}

super.doOperation(paramNmCommandBean, paramList); - create and stored the PN object.

WorkflowHelper.setPR(pobj, paramNmCommandBean); - handle the pobj (pobj is the PN object). In the setPR logic I work with the team of PN. But:

when I try to delete principals from PN team like: deletePrincipalTarget(role, wtpr.getPrincipal()) and role is the custom role the principals are not deleted from team. But if role is the OOTB role then principals are deleted well.

1-Visitor
January 20, 2016

Any specific reason you are calculation team in From Processor, team calculation and role resolution is also depend on workflow. I would suggest preform any team related activities in workflow. Can you call your code in one expression robot in workflow just after start flag.

I am not sure how your Windchill is setup with context team, team template and workflow participants . Your code might be working for ootb role is because ootb role is getting resolved from context team and not working for custom role, because it is getting resolved from workflow .

Thanks

Shreyas