cpenrod - Thursday, November 13, 2014 12:49 PM:
Hi all,
I am trying to make it possible for a part automatically go to the "released" state after its created.
I still need the basic Life Cycle to be used by everyone but for the life cycle to be bypassed if a certain part type is selected.
For example, if I create a part and select "material" under the part type if will automatically be released but if I select component it will stay in the preliminary state until I promote the part further in the Life Cycle.
Any Ideas?
Thanks
Eric Domke - Friday, November 21, 2014 11:17 AM:
Unfortunately, the onAfterAdd server event runs prior to Aras configuring the Life Cycle for the part. This leaves you with a few different options that are varying degrees of painful (but still entirely doable)
- Create an onAfterAdd method that initiates a thread which sleeps for a couple of seconds and then promotes the item
- Create a scheduled task on the server running every few minutes to find items of that part type and promote them
- Create an onAdd method and do everything yourself (** This one I would avoid, especially for the Part item type. I am only including the option for completeness).
Remember, depending on the audit trail and features you desire, you can either create a path in the life cycle and run an actual promotion, or escalate permissions in your server method and SQL update the state and current_state properties directly (and potentially the permission_id, is_released and other properties that the life cycle state would set).
aponceot - Monday, November 24, 2014 3:53 AM:
Hi,
Why don't you create a single state Lifecycle that is released and affect it to your part classification.
That way, all your parts with the specified classification will be automatically released.
The others will follow the standard Lifecycle
cpenrod - Tuesday, November 25, 2014 10:48 AM:
Anthony,
Hey your idea worked great. I had no idea that it was already built in to Aras. For those wondering how to make it work this is what I did.
1. Create a new LifeCycle with just a single state, and named it "Released."
2. TOC > ItemTypes > Part, Under the Life Cycles tab click the "New Relationship Icon."
3. Find the single state Life Cycle you just created and add it.
4. On the right hand side click on "Class Path."
5. Choose the desired part type you want to be a part of the single state Life Cycle.
6. Save and close.
Thanks Again!