2017 June Release

Invoking use casesPermanent link for this heading

Syntax

object.usecase(parameter, ...)


A use case can only be invoked on an object. The full reference of the use case to be invoked must be provided, followed by the list of parameters, which must be enclosed in parentheses. Multiple parameters must be separated by commas.

You do not need to specify optional parameters. They can either be omitted in the parameter list, or denoted as null.

There are four methods for retrieving output parameters in app.ducx expression language:

  • If the method supplies has a parameter which is marked as return value, the method call can be used like a function.
  • If you need to retrieve only one output parameter, the selection operator [] specifying the result parameter position can be used.
  • If you need to retrieve the method object of the call, the selection operator [...] can be used.
  • If you need to retrieve multiple output parameters, variables must be specified for the output parameters in the parameter list and prefixed with an ampersand (&).

Example

// Optional parameters can be omitted
@order.COODESK@1.1:ShareObject(, , #APPDUCXSAMPLE@200.200:customerorders,
  @customer);

// "null" can also be passed in for optional parameters
@order.COODESK@1.1:ShareObject(null, null, #APPDUCXSAMPLE@200.200:
  customerorders, @customer);

// Retrieving an output parameter: method 1 – using the return value

@neworder = #APPDUCXSAMPLE@200.200:Order.ObjectCreate();

// Retrieving an output parameter: method 2 – specify the return value
@neworder = #APPDUCXSAMPLE@200.200:Order.ObjectCreate()[2];

// Retrieving an output parameter: method 3
method @meth = #APPDUCXSAMPLE@200.200:Order.ObjectCreate()[...];
@neworder = @meth.GetParameter(2);

// Retrieving an output parameter: method 4
#APPDUCXSAMPLE@200.200:Order.ObjectCreate(null, &@neworder);