PLM 360 General

Reply
Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 1 of 11 (164 Views)
Accepted Solution

item.workflowItem Scripting Query

164 Views, 10 Replies
03-29-2013 03:44 PM

Hi,

 

Is there any way to access the 'lifecycle' field of the affected items in a revisioning item in scripting (see attached image)? I want to be able to validate via scripting that the user has made a selection (i.e. either 'revise' or 'retire')

 

Thanks,

 

David.

Board Manager
broepke
Posts: 152
Registered: ‎01-24-2004
Message 2 of 11 (149 Views)

Re: item.workflowItem Scripting Query

03-30-2013 07:30 AM in reply to: dkeeley

Hi David,

 

This is totally be possible - I made a quick test to hack together to make sure it works - something like this:

 

While there is no logic here - drop it intoa  new conditional script and you can see the print statement will get you the name of the LC

 

var isOkay = false;

println(item.workflowItems[0].item.descriptor.dvi.lifecycleState.stateName);

returnValue(isOkay);

 

For reference - there is a link here that shows the properties to access the linked items.  Ater you get to the item you can traverse it just like you would a linking pick list or other similar related item.

 

http://wikihelp.autodesk.com/PLM_360/enu/Help/Help/0091-Develope91/0092-Server-S92/0099-Scriptin99#S...



Brian Roepke
Director of PLM & PDM
Autodesk, Inc.

Board Manager
broepke
Posts: 152
Registered: ‎01-24-2004
Message 3 of 11 (147 Views)

Re: item.workflowItem Scripting Query

03-30-2013 07:32 AM in reply to: broepke

Ah..... Sorry - Misunderstood - Reading again I get your point - akin to making it a required field. 

 

I'll see if anyone else knows a way - I'm not familar with that... 



Brian Roepke
Director of PLM & PDM
Autodesk, Inc.

Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 4 of 11 (141 Views)

Re: item.workflowItem Scripting Query

03-30-2013 01:28 PM in reply to: broepke

Hi Brian,

 

Yes as you said - akin to making it a required field. I look forward to hearing the outcome of your enquiry.

 

David.

Product Support
piggeej
Posts: 279
Registered: ‎03-27-2012
Message 5 of 11 (108 Views)

Re: item.workflowItem Scripting Query

04-03-2013 07:51 AM in reply to: dkeeley

David,

 

Following up on this, when an item is in a lifecycle it is already predefined as unreleased (on creation of the item).

 

So by using the script predefined by Brian,

One could create a Validation script that will check for the given state (revise or retire), or to check that the given state is not equal to unreleased ( this would be the easier way to go). This will in turn force alert the user that they must complete that required section. 



Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.

Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 6 of 11 (105 Views)

Re: item.workflowItem Scripting Query

04-03-2013 08:01 AM in reply to: piggeej

Hi Joe,

 

Thanks for the reply. But I'm still a little unclear on this.

 

Its not the item lifecycle state that I need to check. I want to be able to check what lifecycle transition has been selected for items on the 'affected items' table. Please see the image I attached to an earlier post.

 

Perhaps I haven't picked you up correctly?

 

Thanks,

 

David.

Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 7 of 11 (103 Views)

Re: item.workflowItem Scripting Query

04-03-2013 08:03 AM in reply to: dkeeley

I also raised an Idea Station entry for this that might shed more light on it.

 

Idea Station entry

Product Support
piggeej
Posts: 279
Registered: ‎03-27-2012
Message 8 of 11 (97 Views)

Re: item.workflowItem Scripting Query

04-03-2013 08:20 AM in reply to: dkeeley

David,

 

Ok I think i have narrowed down what you are asking about

 

Based on the picture shown, whatever the user inputs for that field, and then saves it. That is what the script will return. If nothing is selected then it will auto default to the last selection made, If it is a new item then it will default to unreleased.



Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.

Mentor
dkeeley
Posts: 214
Registered: ‎10-04-2012
Message 9 of 11 (94 Views)

Re: item.workflowItem Scripting Query

04-03-2013 12:47 PM in reply to: piggeej

Hi Joe,

 

I did some testing on the scipt you provided. I think it returns the 'current' lifecycle state of the item in the affected items table. 

 

I completed the following steps;

 

1. Created a new revision-controlled item (item A)

2. I created a new revisioning item (item B)

3. I attached item A to the 'affected items' tab of item B

4. I ran the script you provided on item B. Result was 'Unreleased'

5. I changed the 'lifecycle' value in the affected items table for item A. 

6. I ran the same script again. Result was 'Unreleased'

 

Is there something that I'm missing here? The lifecycle of the item A wont change until item B reaches the 'managed state'.

 

Thanks,

 

David.

Product Support
piggeej
Posts: 279
Registered: ‎03-27-2012
Message 10 of 11 (92 Views)

Re: item.workflowItem Scripting Query

04-03-2013 12:55 PM in reply to: dkeeley

David,

 

Nope not missing a thing, I stand corrected (retested myself), I'll see to it as to support your submission to the IdeaStation :smileyhappy:



Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Ask the Community