Pushing a workflow attribute to a soft type document
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Pushing a workflow attribute to a soft type document
I have pushed attributes from a Change Activity to a Change Notice upon completion of the activity. Now what I would like to do is push an attribute from a document approval workflow to a soft type of document. I have defined a workflow variable called string1 as type java.lang.String and also a variable parentDocument of type wt.doc.WTDocument. I tried to use the logic that I had but I am getting an error. It would be great if this possible.
Here is my transition code:
com.ptc.core.lwc.server.LWCNormalizedObject obj=new com.ptc.core.lwc.server.LWCNormalizedObject(parentDocument,null,null, new com.ptc.core.meta.common.UpdateOperationIdentifier());
obj.load("string1");
obj.set("string1",internal_name_string_on_softtype);
obj.apply();
wt.fc.PersistenceHelper.manager.modify(parentDocument);
The error I get when I check the syntax is:
warning: Supported source version 'RELEASE_7' from annotation processor 'com.microsoft.azure.management.apigeneration.LangDefinitionProcessor' less than -source '1.8'
WfExpression_10802.java:43: error: cannot find symbol
obj.set("string1",internal_name_string_on_softtype);
^
symbol: class hoshinet
location: package com
Note: WfExpression_10802.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: WfExpression_10802.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
1 warning
Syntax check complete.
- Labels:
-
API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Your issue is you quoted string1 instead of using it as a variable name. Try this:
obj.load(string1);
obj.set(string1,internal_name_string_on_softtype);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@RandyJones I got the same error when I took out the quotes. On my task to notice string variables I have quotes on them. That is why I had used them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@RandyJones I figured it out as far as the syntax. I needed to change string one with internal_name_string_on_softtype. Once I did this, I did not get a syntax error. I still need to finish building my workflow so that I can test it out. I went back and looked at my other code and that is when I realized what I had done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am glad you figured it out. As a side note the LWCNormalizedObject class has been deprecated and replaced by the PersistableAdapter class:
https://www.ptc.com/en/support/article/CS138252
