Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
5 subscribers
Views
1472 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Hello All, Currently I am working on a plugin where i need to set valu
syedi
over 7 years ago
Hello All,
Currently I am working on a plugin where i need to set value for "ProcessVariable" object, to pass into "ProcessStartConfig" object. But ProcessVariable setValue() function is deprecated as it origins from the TypedVariable. Even though it's working fine , since it's deprecated is there any other way to set the value other than using setValue() for ProcessVariable. or is it fine to use this function ?
OriginalPostID-228642
OriginalPostID-228642
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 7 years ago
Example:
TypedValue typedValue = new TypedValue(Long.valueOf(AppianType.INTEGER), new Long(100));
NamedTypedValue namedTypeValue = new NamedTypedValue(typedValue,"anIntegerNumberPV");
ProcessVariable pvInstance = new ProcessVariable(namedTypeValue);
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
syedi
over 7 years ago
Thanks Eduardo, For creating new variable this one looks fine , but i want to assign the value to the existing ProcessParameter. I tried creating the new ProcessVariable similarly and tried to assign the name ,value and instance and then passed it as ProcessParameter but it doesn't accept it. any other suggestion for existing process variable?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 7 years ago
I am not creating new variables. They are variables that my process model already has. I am just creating the abstraction of those variables for my Java code to be able to identify them by Name.
Here's how I start a process that requires 3 pv's. I am populating those pv's
ProcessVariable[] processVariables = new ProcessVariable[3];
TypedValue typedValue = new TypedValue(Long.valueOf(AppianType.INTEGER), new Long(100));
NamedTypedValue namedTypeValue = new NamedTypedValue(typedValue,"anIntegerNumber");
ProcessVariable pvInstance = new ProcessVariable(namedTypeValue);
processVariables[0] = pvInstance;
typedValue = new TypedValue(Long.valueOf(AppianType.STRING), new String("fromAPI"));
namedTypeValue = new NamedTypedValue(typedValue,"wMyOtherText");
pvInstance = new ProcessVariableInstance(namedTypeValue);
processVariables[1] = pvInstance;
typedValue = new TypedValue(Long.valueOf(AppianType.STRING), new String("fromAPI2"));
namedTypeValue = new NamedTypedValue(typedValue,"zMyText");
pvInstance = new ProcessVariableInstance(namedTypeValue);
processVariables[2] = pvInstance;
ProcessStartConfig config = new ProcessStartConfig();
config.setProcessParameters(processVariables);
pds.initiateProcess(processModelId, config);
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
syedi
over 7 years ago
Thanks Eduardo , It seems to be working fine. I should have missed something at first time.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel