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

Promotion collection filter

SOLVED
Highlighted

Promotion collection filter

Is there a way to auto exclude parts from a certain context from being collected in the promotion process?  I don't want library items showing up in the collector.

 

Thanks,

 

Mike

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Promotion collection filter

Mike,

 

I looked into this and learned that when you are at the stage of "Select Promotion Objects" the system doesn't really care (or know) what the purpose of the collection is (Add to Workspace, Promotion Request, etc).  Therefore, it's difficult to stop the collection because there's no way to know if the collection is for a Promotion Request.

 

However, if the objective is to stop objects in a specified context from being promoted there is a way to do that.

A listener can be written to listen for a POST_STORE event.

The code in the listener would check if the object being stored is a Promotion Notice.

If it is a Promotion Notice check the objects being promoted.

If any of them are in the specified context remove them from the Promotion Request.

 

That said, if you want to prevent users from adding objects from the specified context to the Promotion Request after it is created it might be more bomb-proof to check for the creation of a PromotionTarget, which is the link that links the Promotion Request to the object being promoted.  If the object pointed to by the PromotionTarget is in the specified context, delete the PromotionTarget.

 

Not sure if this would be good enough but if the goal is a bomb-proof way of preventing objects in a context from being promoted this would do it.

 

If this sounds interesting and you need more help feel free to drop me a message.

 

David

View solution in original post

4 REPLIES 4
Highlighted

Re: Promotion collection filter

Mike,

 

I looked into this and learned that when you are at the stage of "Select Promotion Objects" the system doesn't really care (or know) what the purpose of the collection is (Add to Workspace, Promotion Request, etc).  Therefore, it's difficult to stop the collection because there's no way to know if the collection is for a Promotion Request.

 

However, if the objective is to stop objects in a specified context from being promoted there is a way to do that.

A listener can be written to listen for a POST_STORE event.

The code in the listener would check if the object being stored is a Promotion Notice.

If it is a Promotion Notice check the objects being promoted.

If any of them are in the specified context remove them from the Promotion Request.

 

That said, if you want to prevent users from adding objects from the specified context to the Promotion Request after it is created it might be more bomb-proof to check for the creation of a PromotionTarget, which is the link that links the Promotion Request to the object being promoted.  If the object pointed to by the PromotionTarget is in the specified context, delete the PromotionTarget.

 

Not sure if this would be good enough but if the goal is a bomb-proof way of preventing objects in a context from being promoted this would do it.

 

If this sounds interesting and you need more help feel free to drop me a message.

 

David

View solution in original post

Highlighted

Re: Promotion collection filter

David,

 

I really appreciate the info back...  sounds like there is some real tinkering involved... I'm at the beginning of my journey to being a rounded out admin!

 

I'll file those suggestions for later when I'm got some more time and am more brave!

Highlighted

Re: Promotion collection filter

Mike,

 

Some friendly advise, if you want to be a "well-rounded" admin you're going to need to know Java and how to write code using the Windchill API library.  Without that skill you're going to be very limited.  With that skill you can do almost anything.  Additionally, an understanding of how to interrogate the dB itself is extremely helpful. If I'm trying to figure out how to do something I've never done using the APIs I often dig into the dB and figure out what's going on under the hood (how the tables/columns are related to each other).  Once I know that the rest is usually pretty easy.

 

David

 

David

Highlighted

Re: Promotion collection filter

I really appreciate the advice!  Going to slide that up on the list of things to learn!

Announcements