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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Adding a value to an attribute though a workflow task

vmcdaniel
2-Guest

Adding a value to an attribute though a workflow task

Guru's,

We would like to add a value to our Promotion Request attribute ATT1, while the PR workflow is executing. Ideally, this would happen by a user entering it into the TASK, next to the comments field. Is it possible to add an attribute field to the task, that can push to the PR object?

Vaughn
4 REPLIES 4

Must have "read only" checked for the variable for it to display this way.

[cid:image002.png@01CD7560.40DE8ED0]

I have the code figured out, but when I Check the Syntax, I get a "cannot find ECN_SAP" error.
Is my syntax not right for telling to set the value of the workflow variable ATT1 to the PR attribute ECN_SAP?


com.ptc.core.lwc.server.LWCNormalizedObject obj = new com.ptc.core.lwc.server.LWCNormalizedObject(primaryBusinessObject,null,null, new com.ptc.core.meta.common.UpdateOperationIdentifier());
obj.load("ATT1");
obj.set("ATT1",ECN_SAP);
obj.apply();
wt.fc.PersistenceHelper.manager.modify(primaryBusinessObject);


-Vaughn

I'm not sure which direction you're trying to go - from PR to workflow
attribute, or workflow attribute to PR....



The email at bottom says "add a value to PR attribute ATT1"



The email just below says "set workflow variable ATT1 to PR attribute
ECN_SAP" (other way around). For that, it would be more like...



com.ptc.core.lwc.server.LWCNormalizedObject obj = new
com.ptc.core.lwc.server.LWCNormalizedObject(primaryBusinessObject,null,null,
null);

obj.load("ECN_SAP");

Object softAttribValue = obj.get("ECN_SAP");

if (softAttribValue instanceof String) {

ATT1 = (String) softAttribValue;

}



Or if you mean the workflow variable is ATT1, and you wish to push it to the
PR, where the PR's attribute is ECN_SAP, then something close to:

com.ptc.core.lwc.server.LWCNormalizedObject obj = new
com.ptc.core.lwc.server.LWCNormalizedObject(primaryBusinessObject,null,null,
new com.ptc.core.meta.common.UpdateOperationIdentifier());

obj.load("ECN_SAP");

obj.set("ECN_SAP",ATT1);

obj.apply();

wt.fc.PersistenceHelper.manager.modify(primaryBusinessObject);








Top Tags