ECR Change Classification in the ECN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
ECR Change Classification in the ECN
I need to add a conditional to the ECN workflow that is dependent on the change classification of the ECR. Basically, if the ECR classification is equal to "Obsolete" then take this route, otherwise, take this route. I am struggling with the syntax and possibilities within the workflow editor. Any help would be appreciated.
Regards,
James Little
- Labels:
-
Other
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Anyone have any suggestions for this? I would really appreciate some help or insight.
Thanks,
In Reply to James Little:
I need to add a conditional to the ECN workflow that is dependent on the change classification of the ECR. Basically, if the ECR classification is equal to "Obsolete" then take this route, otherwise, take this route. I am struggling with the syntax and possibilities within the workflow editor. Any help would be appreciated.
Regards,
James Little
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It is very straight forward.
1. Edit ECN workflow,
2. Add conditional router in appropriate place
a. Choose Conditional as Routing Type
b. Add Routing events within Routing Events pan
c. Under Routing Expression, find the ECR using API like QueryResult
result = QueryResult queryresult =
ChangeHelper2.service.getChangeRequest((wt.change2.WTChangeOrder2)primaryBus
inessObject), true);
d. From the queryresult get the ECR
e. Find ECR Classification
f. if (ecrClassification.equals("obsolete")) result =
"Obsolete_Route"; else result = "route2";
if you need any specific clarifications, please shoot me a line or give me a
call.
Thank you and have a great time.
Best Regards
Swamy Senthil
Principal Solutions Architect
973 216 0456(M); 973 324 2729(W); 866 908 6561(F)
Work Email: swamy.senthil@swasen.com
LinkedIn Profile:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
the results.
I appreciate your response.
James Little
Corning Cable Systems
CAD Administrator
Jeremiah 33:3 "Call to Me, and I will answer you, and show you great and
mighty things, which you do not know."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
if
(customization.workflow.GoodrichWorkflowProcessHelper.isValidAutoAccept(
(wt.change2.WTChangeRequest2)primaryBusinessObject))
{
ECCreator=customization.workflow.GoodrichWorkflowProcessHelper.getECRCre
ator((wt.change2.WTChangeRequest2)primaryBusinessObject);
ccbcDecision="Approve";
analysisComments="Auto-Accepted";
approvalDate=new
java.sql.Timestamp(System.currentTimeMillis());
com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setTr
ack((wt.change2.WTChangeRequest2)primaryBusinessObject, "SIMPLE");
result="Accept";
}
else
{
com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setTr
ack((wt.change2.WTChangeRequest2)primaryBusinessObject, "COMPLEX");
result="Continue";
}
But the code you want is here (externalized):
public static boolean isValidAutoAccept(WTChangeRequest2 ecr) throws
WTException
{
Category category=ecr.getCategory();
//if we have an auto-acceptable category
if
((category==Category.toCategory("INITIAL_RELEASE"))||(category==Category
.toCategory("ENG_ERROR")))
{
//and the creator is part of the Product area team
(CONFIRMED)
ContainerTeamManaged containerteammanaged =
(ContainerTeamManaged)ecr.getContainer();
Enumeration enumeration =
((ContainerTeam)containerteammanaged.getContainerTeamReference().getObje
ct()).getMembers().elements();
while(enumeration.hasMoreElements())
{
WTPrincipalReference wtprincipalreference =
(WTPrincipalReference)enumeration.nextElement();
WTPrincipal wtprincipal =
(WTPrincipal)wtprincipalreference.getObject();
if(wtprincipal instanceof WTUser)
{
WTUser wtuser = (WTUser)wtprincipal;
if (wtuser.getName().equals(ecr.getCreatorName()))
return true;
}
}
}
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator