I'm trying to write a plugin which could call Appian API which take CDT as p

I'm trying to write a plugin which could call Appian API which take CDT as parameter by using processDesignService.initiateProcess, referencing a library typetransformer-1.2.jar

I had the following exception(Log attached):
RROR com.appiancorp.suiteapi.common.TypedValueParameterConverter - unable to access property <value> in <class com.appiancorp.suiteapi.process.ProcessVariable>

Main logic Code :

//Appian CDT Type
                                        if (processInstanceType.intValue() >= 500) {
                                                  String cdtType = ts.getType(
                                                                      processVariable.getInstanceType()).getName();
                                                  String cdtNameSpace = ts.getType(
                                                                      processVariable.getInstanceType()).getNamespace();
                                                  
                                                  System.out.println("cdtNameSpace: "
                                                                      + cdtNameSpace);
                                                  System.out.println("cdtType: "
                                                                      + cdtType);

                                                  Datatype type = ts.getTypeByQualifiedName(new QName(
                                                                       cdtNameSpace,cdtType));
                                                  
                                                  AppianObject account = (AppianObject) tf.createElement(type
                                                                      .getId());
                                        ...

plugin.log

OriginalPostID-171467

OriginalPostID-171467

  Discussion posts and replies are publicly visible

Parents
  • ...          account.put("accountNumber_txt",
                                                                          tf.createString("900900900"));
                                                      account.put("name_txt", tf.createString("Ping"));
                                                      System.out.println("account: "+account.toString());
                                                      
                                                      TypedValue tv = tf.toTypedValue(account);
                                                      System.out.println("typedvalue for account: "+ tv);
                                                      NamedTypedValue ntv = new NamedTypedValue(tv,"account_cdt");
                                                      System.out.println("namedtypedvalue for account: "+ ntv);
                                                      pvi = new ProcessVariableInstance(ntv);
                                            }

    System.out.println("Process Parameters Length:"
                                                      + processParameters.length);

                                  //ProcessStartConfig processStartConfig = getProcessStarterConfig(processParameters);
                                  ProcessStartConfig processStartConfig = getProcessStarterConfig(new ProcessVariable[]{pvi});
                                  processId = processDesignService.initiateProcess(modelId,
                                                      processStartConfig);

Reply
  • ...          account.put("accountNumber_txt",
                                                                          tf.createString("900900900"));
                                                      account.put("name_txt", tf.createString("Ping"));
                                                      System.out.println("account: "+account.toString());
                                                      
                                                      TypedValue tv = tf.toTypedValue(account);
                                                      System.out.println("typedvalue for account: "+ tv);
                                                      NamedTypedValue ntv = new NamedTypedValue(tv,"account_cdt");
                                                      System.out.println("namedtypedvalue for account: "+ ntv);
                                                      pvi = new ProcessVariableInstance(ntv);
                                            }

    System.out.println("Process Parameters Length:"
                                                      + processParameters.length);

                                  //ProcessStartConfig processStartConfig = getProcessStarterConfig(processParameters);
                                  ProcessStartConfig processStartConfig = getProcessStarterConfig(new ProcessVariable[]{pvi});
                                  processId = processDesignService.initiateProcess(modelId,
                                                      processStartConfig);

Children
No Data