I wrote a custom servlet plugin that calls the process model (Say A) with some p

I wrote a custom servlet plugin that calls the process model (Say A) with some parameters. I have designed the pm in one of the node with the same pv names . When we invoke the servlet , the pm gets triggered but the pv values that I'm passing from servlet are not getting mapped in the pm instance that started. Please help me if I'm wrong in my understanding and code implementation.

My PM has Start Node, a Script Task and End Node . Script task I had configured the pv's as parameters.

TypedValue typedValue = new TypedValue(Long.valueOf(AppianType.INTEGER), new Long(100));
           NamedTypedValue namedTypeValue = new NamedTypedValue(typedValue,"anIntegerNumber");
           ProcessVariableInstance pvInstance = new ProcessVariableInstance(namedTypeValue);

                    
                    ProcessVariable[] processVariables = new ProcessVariable[3];
                    processVariables[0] = pvInstance;
                    
                     typedValue = new TypedValue(Long.valueOf(AppianType.STRING), new String("fromAPI"));
                     namedType...

OriginalPostID-183644

OriginalPostID-183644

  Discussion posts and replies are publicly visible

  • ...Value = 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);
                        
                        try {
                                  pes.initiateProcess((long)1576, config);
                        } catch (Exception e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                        }
  • Take a look at the source for Start Process Writer in shared components for ideas and to debug.

    (sorry I'm on mobile and couldn't review your code and couldn't copy paste the link to the start process writer record)
  • Hi Senthilkumark, could you tell us what you did? I am also stuck on the same step as yours.