xpxDotNetInvoke

FUNCTION xpxDotNetInvoke (objecthandle             : INTEGER;
                          methodName               : STRING;
                          arg1, arg2, arg3, arg4,
                          arg5, arg6, arg7, arg8   : GENERIC)
                          status                   : INTEGER;

The xpxDotNetInvoke method is identical xpfDotNetInvoke except that the .Net method cannot have a return value, i.e. a void method.

The different types of input parameters are treated as follows:

  • sdaiINTEGER and sdaiLOGICAL are translated to int.
  • sdaiREAL is translated to double.
  • sdaiBOOLEAN is translated to bool.
  • sdaiSTRING, sdaiBINARY and sdaiENUMERATION is translated to string.
  • For objects the object id in the EDM database or EDM virtual machine is translated to int.
  • Aggregate of sdaiINTEGER, sdaiBOOLEAN or sdaiLOGICAL is translated to List<int>.
  • Aggregate of sdaiREAL is translated to List<double>.
  • Aggregate of sdaiSTRING, sdaiBINARY or sdaiENUMERATION is translated to List<string>.
  • For aggregate of objects the object id in the EDM database or EDM virtual machine of the objects is translated to List<int>.

Arguments


1TypeNameComment
2INTEGERobjecthandleMandatory - handle to the .NET object
3STRINGmethodNameMandatory - method name within the .NET object
4GENERICarg(n)Optional, input parameters to the .Net method.

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_XPX_Return_Value'.

Options


 

Example


public class Class1
{
  public Class1() 
  {
  }
  public void setListOfString(List<int> intList)
  {
      List<string> returnValue = new List<string>();
      foreach (int i in intList) {
          returnValue.Add(i.ToString());
      }

  }
   public string getString(string s)
   {
      return s;
   }
}


and the EDMexpressX method that executes the two methods in Class 1:

QUERY_FUNCTION testDotNetPlugin_1() : STRING;
   LOCAL
                               object          : INTEGER;
      resultString    : STRING;
      input           : LIST OF INTEGER;
      resultList      : LIST OF STRING;
                END_LOCAL;

   input ++ 1; input ++ 2; input ++ 3;
   object := xpfCreateDotNetObject('GuruTest.Class1');
   xpxDotNetInvoke(object, 'setListOfString', input);
   -- dotnetResult is a list of string contating 3 strings with values '1', '2' and '3'.
   result := xpfDotNetInvoke(object, 'returnString', 'Hello EPMT');
   -- result contains the string 'Hello EPMT'
   return (result);
END_QUERY_FUNCTION;

 

See also

Filter by label

There are no items with the selected labels at this time.

Â