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

Windchill 9.1 Custom Workflow help

SOLVED
Newbie

Windchill 9.1 Custom Workflow help

I am trying to create a custom workflow in Windchill 9.1. I want to have a decision made that will cause the workflow to travel one path or the other for a few items, merge back together for the next few items, then split for the last item based on the earlier decision. I think I can do it with Execute Expression Robots and variables. Any one out there able to help with the scripting, or perhaps suggest a better way.

Currently I use two consecutive workflows, but much of the information requested in the first, is also requested in the second. This means the initiator not only has to initiate two workflows, but also re-enter information that was previously entered in the first workflow. Being able to start one workflow, have the user choose a path and later use that same choice to determine the direction to take on the next fork, would greatly help ease user adoption to the system we've just begun to use.

New to Released Promotion.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Windchill 9.1 Custom Workflow help

I used the check syntax command and I did not have any syntax errors. However, I will try the double equal sign. It may be they are both allowable, but each has a different purpose. I am only hypothesizing, as I have only the experience I gained from my mistakes yesterday.

View solution in original post

18 REPLIES 18

Re: Windchill 9.1 Custom Workflow help

standard stuff

1. Create a workflow variable and have set near the beginning of the workflow, probably by a user via an activity

2. Use that variable value in any number of conditionals later in the workflow to branch the flow.

Re: Windchill 9.1 Custom Workflow help

That's great... unfortunately, I don't have the experience with the coding to do this. So if anyone reads this post who does have that experience and can create some sample code for me to play with, I will be eternally grateful.

Re: Windchill 9.1 Custom Workflow help

How are things in this area lately? Still need help?

Highlighted

Re: Windchill 9.1 Custom Workflow help

Conditional Block.png

1) Create a variable in the workflow of type boolean.

2) Write your question name in the display name of that variable.

3) Add this variable to the activity you want, where it will be answered.(Will be ticked if yes)

4) Now the answer i.e. Yes or No will be saved in the boolean variable.

5) When you want to use it for further routing you can put a conditional block-

Select the Routing type- Conditional.

The Code is-

if(Userip.equals("Inhouse"))

result="Production";

else if(Userip.equals("Outsourced"))

result="Procurement";

else

result="Both";

6) Here Userip is my variable Name.

And the options provided in result should be provided in Roting Events.

Re: Windchill 9.1 Custom Workflow help

Hi Dhanashri,

How can I use the conditional connector to route the process relative to a value returned from the primarybusiness object's attribute.

Regards and Thanks

Re: Windchill 9.1 Custom Workflow help

1) You can create a variable in your workflow eg-IBAValue_EnggFuntion and use the below code to get the attributes of Primary buisness object. The first line of the code depends on the type of your buisness object in this case it is a problem report. In the code below the ViewByPath given is "Engineering_Function", this is the name of the attribute whose value you want to capture.

2) Once you get the attribute value in your workflow variable you can use that variable in conditional connector to route the process.

/*************Code**********************/

wt.change2. WTChangeIssue cm1 = (wt.change2.WTChangeIssue) primaryBusinessObject;

wt.iba.value.IBAHolder ibaHolder1 = (wt.iba.value.IBAHolder)cm1;

ibaHolder1 =wt.iba.value.service.IBAValueHelper.service.refreshAttributeContainer(ibaHolder1, null, null, null);

wt.iba.value.DefaultAttributeContainer attributeContainer =(wt.iba.value.DefaultAttributeContainer) ibaHolder1.getAttributeContainer();

wt.iba.definition.service.StandardIBADefinitionService defService = new wt.iba.definition.service.StandardIBADefinitionService();

wt.iba.definition.litedefinition.AttributeDefDefaultView attributeDefinition = defService.getAttributeDefDefaultViewByPath("Engineering_Function");

wt.iba.value.litevalue.AbstractValueView svc = attributeContainer.getAttributeValues(attributeDefinition)[0];

IBAValue_EnggFuntion = svc.getLocalizedDisplayString();

Re: Windchill 9.1 Custom Workflow help

Hi Dhanashri,

Firstly; what should I select by the Type Name, when creating the variable?

Secondly; I have a soft type for the type "Reference Document" and the object type name is as follows:

wt.doc.WTDocument|com.ptc.ReferenceDocument|ZA.CO.ROUTEHOLDINGS.SATBOrder

I understand that I need to give the attribute name at the view by path. Is this the only place in the code that I change? does everything else stay the same?

Thanks

Re: Windchill 9.1 Custom Workflow help

That is very helpful. I can rename the variable and the results, but I still don't know how to set the variable in the first place and where.

Re: Windchill 9.1 Custom Workflow help

You can define the variable globally by defining it in properties, when you edit a workflow template.

I have attached the screenshots..

Workflow.gif

Announcements
LiveWorx Call For Papers Happening Now!