Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

item.workflowItem Scripting Query

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
dkeeley
621 Views, 10 Replies

item.workflowItem Scripting Query

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.

Tags (2)
10 REPLIES 10
Message 2 of 11
broepke
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, Analytics & Insights
Message 3 of 11
broepke
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, Analytics & Insights
Message 4 of 11
dkeeley
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.

Message 5 of 11
jpiggee
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. 

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 6 of 11
dkeeley
in reply to: jpiggee

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.

Message 7 of 11
dkeeley
in reply to: dkeeley

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

 

Idea Station entry

Message 8 of 11
jpiggee
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.

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 9 of 11
dkeeley
in reply to: jpiggee

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.

Message 10 of 11
jpiggee
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 Smiley Happy

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 11 of 11
dkeeley
in reply to: jpiggee

Thanks Joe.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums