Hello, as you know, this code checks whether a Change Notice has been opened in the Change Request and closes the task if it has been opened.
I want to do the same thing in two problem reports, but I couldn't edit the code.
Could you help?
result = result="CREATE_CN";
if(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.changeNoticeExists((wt.change2.FlexibleChangeItem)primaryBusinessObject)) {
result="AUTO_CREATED_CN";
}
Solved! Go to Solution.
Hello Onur,
Associated Change Request will be created as "Children" It is correct. So you need to use this one,
result = null;
if(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.isRelatedChildrenInStates((wt.lifecycle.LifeCycleManaged)primaryBusinessObject, new String[]{"RESOLVED","CANCELLED"})) {
result = "Resolved";
}
but an Associated Problem Report will be created as a "Parent" Object. So, you need to use the one below.
result = null;
if(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.isRelatedParentsInStates((wt.lifecycle.LifeCycleManaged)primaryBusinessObject, new String[]{"UNDERREVIEW"})) {
result = "Resolved";
}
and select this as an object event.
Are you looking to do this from the Problem Report workflow looking at the Change Request or looking ahead at the Change Notice? OOTB, the Problem Report end with its acceptance. When linked to a CR and eventually the CN, when they close, it propagates backward and moves the PR to a resolved state. I am not sure where that code is done. Are you looking at keeping the PR workflow running until the CR is associated?
Hello Avillanueva, thank you for your answer.
What I'm talking about here is an internal process that is completely independent of change management. You can think of it like a ticket process. I have a problem report type error reporting system that I set up for users. After this is opened, the user starts another problem report called "solution" within the same problem report type.
My purpose; Having the user open the "solution" type. I created a task for this and the task goes to the user. However, even if the user does this automatically, I want this task to be closed automatically. 🙂
Everything I mentioned is just like initiating a change notification during the change request process.
I'm sure the situation will be a little clearer in the attached photos.
Have you configured business rules that PRs are linked together as a change process?
If so then you can use the OOTB code to check if the related PR is or is not in specific state
boolean isInSatte = com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.isRelatedChildrenInStates(cam, new String[]{"NEW","OPEN","OPENED","RESOLVED","CANCELLED"});
You just need to play with result in the workflow.
For example, if the PR is in state RESOVLED, then finish the task
PetrH
Hi @HelesicPetr ,
I think I will use the code you mentioned in sync.
So, what should I write in the conditional to trigger the task to close?
I did exactly what you said, Helesic, but it still doesn't close the task automatically, I think we need a small adjustment. 🙂
You need to specify the way from synchronization robot to task if is accepted with option Complete.
Then if the synchronization robot goes forward it will also complete the task.
If the synchronization robot is in the child workflow, then it is wrong and you need to specify the synchronization robot in the parent workflow where you need to complete the task
PetrH
Hello Onur,
Associated Change Request will be created as "Children" It is correct. So you need to use this one,
result = null;
if(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.isRelatedChildrenInStates((wt.lifecycle.LifeCycleManaged)primaryBusinessObject, new String[]{"RESOLVED","CANCELLED"})) {
result = "Resolved";
}
but an Associated Problem Report will be created as a "Parent" Object. So, you need to use the one below.
result = null;
if(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.isRelatedParentsInStates((wt.lifecycle.LifeCycleManaged)primaryBusinessObject, new String[]{"UNDERREVIEW"})) {
result = "Resolved";
}
and select this as an object event.
Hi @egun
I've understood that @OnurNalbantgl needs to close the task in the parrent Problem report worflow that should be controled by child Problem report's state.
PetrH
@cyildirim @HelesicPetr @avillanueva @egun thanks everyone.
@cyildirim
I think there was a problem in my test environment, it worked in the live environment. thanks.