Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
I would like to add some inputs to my promotion request approve task. There are comment inputs and vote inputs.... but I wanted to add a could of boolean attributes (radio buttons would be nice) for common reasons for rework. Then, I can collect report data about why Promotion requests are being sent back for rework.
Stuff like that.
I thought I saw an article that says it's not possible but want to ask the community if they think otherwise or have an alternative solution.
The referenced buzz kill...
https://www.ptc.com/en/support/article/CS310508
Solved! Go to Solution.
I am not sure that article means what we think it means. I just created a workflow with two boolean attributes and tested it. Displays like this:
You should be able to create a variable in the workflow and also in the task to gather inputs. Then you can write logic around it. Am I missing something? Seems pretty OOTB.
So I can definitely do it in the workflow... I know how to get user input variables in there... and even pass them to the task. But... That screen shot you have... is that from a task? The user would have to input that in the task.
Yes, that is the task page. You add boolean variables to the task and you make them visible and editable. It should join to the same variable at the process level so you can use it in logic code. Seems like you know about workflows. I do not think I understand the issue of why it cannot be done.
I was trying to do that in the type and attribute manager for work item... is this done in the activity inside the work flow then?
yep
Ok... I'm having a block tonight... I know where to make the variable... not cannot at this time recall where I add the attribute so it shows up in the task. I see you were able to add it after the subject...
@avillanueva wrote:
Yes, that is the task page. You add boolean variables to the task and you make them visible and editable. It should join to the same variable at the process level so you can use it in logic code. Seems like you know about workflows. I do not think I understand the issue of why it cannot be done.
I think that article is refering to attributes added with AddColumns.sh in conjunction with Type and Attribute Management.
You may be wanting to use this:
Hi All... thank you for the input so far... I can create the variable in the process, and activity.... but I am at a loss for getting it to just 'show up' in the task. Where do I set where that variable is located as a check box in the activity.. Simply creating the variable doesn't get it to show up in the activity does it?
edited 5 min later... ok.. so it does just show up... but by pure chance it's because I added a new tab to the layout with the variables on it previously when I was experimenting.
Need to figure out how to get it to show on the first tab now and collect the info.
If you set the attribute it is generally shown in the input of the task. In my case
Boolean CheckParams
I just set the parameter as required
PetrH
My OOTB set up isn't dropping it in there. 11.2 by the way... And my table/attributes is not called "Inputs" like yours. Mine says task completion. I'm guessing that I just haven't figured out where to edit those task template options. I had to add the Task Variables option to my Task Template to get them on the the first tab.
Where do I go to mess with that stuff?!
It depends how the template format and template are set in the Workflow definition.
For native format, you need to define specific format where you can define what you see.
The native format definition is done on site level in a task form template
This task form template should be available in wch 11.1+ so your windchill should support it
PetrH
As usual, being very precise in terminology is needed.
General simple case (workflow only): Create and use variables only within the workflow.
- Create as global workflow variables; possibly set a default value (if string, this can serve as a brief instruction)
- For each task or robot that needs to address variable(s), create, then initialize from; set permisssions
General more complex case (PBO attributes):
- Create workflow variable(s) as above, corresponding to PBO attribute(s); have to match data type (e.g. String)
- In workflow robot, "Get" current value of PBO attribute (e.g. an attribute on a Change Request)
- If user needs to set value, Initialize workflow variable to Task as above
- In workflow robot, "Set" the updated value back to the PBO
In either case, the layout of the Task can be managed via task templates
Thank you everyone! I am so close now... I was able to take my boolean variables, use an expression robot to count how many times they values were set to true. Send that int up to the process level From there I was able to create a Type Management Reusable attribtute (int), use the same expression robot to set the value of the PBO attribute... and my background method server log reports the value correctly... but the value does not appear visible... Nor does the value show up when I use a report. It will return the Promotion Request but the "RWDI" attribute shows nothing. The attribute is set to read/write, not value hidden. Attached is what I see when I display the attribute on the layout. I really only need it for reporting though... Still Where's my value?
Noticed thought that each time the expression robot runs... I print the current value and then the new value... Goes.. Null to 1, then Null to 2. Expected would have been 1 to 2. Like setting the value doesn't stick.
It would be good if you share how you save the value to the PBO Promotion Notice IBA attribute.
I guess that there is missing last point to store the new value in database.
obj.apply();
wt.fc.PersistenceHelper.manager.modify(pn);
check the Article cs346972
PetrH
Thank you! That was it!