cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

problem report synchronization

OnurNalbantgl
12-Amethyst

problem report synchronization

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";

}

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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.

cyildirim_0-1695395488806.png

 

View solution in original post

11 REPLIES 11

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.

 

OnurNalbantgl_0-1695273078716.png

 

OnurNalbantgl_1-1695273096904.png

 

 

Hi @OnurNalbantgl 

Have you configured business rules that PRs are linked together as a change process?

HelesicPetr_0-1695277817851.png

HelesicPetr_1-1695277866646.png

 

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?

Hi @OnurNalbantgl 

You just use the synchro robot that will complete the task what you need. 

HelesicPetr_0-1695280268597.png

 

PetrH

I did exactly what you said, Helesic, but it still doesn't close the task automatically, I think we need a small adjustment. 🙂

 

OnurNalbantgl_0-1695301532539.png

 

Hi @OnurNalbantgl 

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.

cyildirim_0-1695395488806.png

 

egun
7-Bedrock
(To:cyildirim)

incredible work @cyildirim !!👌

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. 

Top Tags