Hello All, Currently I am working on a plugin where i need to set valu

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

Parents
  • 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);
Reply
  • 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);
Children
No Data