Community articleevaluateFunctionCall method
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Description

Use this method to call a package function. Since package functions assume that they are called by the API, this method establishes any additional parameters that the function may be expecting. Generally, function calls in a package should not be called directly since there are more parameters that must be passed.

Method

public void evaluateFunctionCall(
   String thePackageName, 
   String theFunctionName,
   int theFunctionInstance,
   short theCommand, 
   com.PureEdge.xfdl.FormNodeP theForm, 
   com.PureEdge.xfdl.FormNodeP theComputeNode, 
   com.PureEdge.xfdl.FormNodeP [] theArgList, 
   com.PureEdge.xfdl.FormNodeP theResult
  ) throws UWIException;


Parameters

ExpressionTypeDescription
thePackageNameStringThe name of the package that contains the function.
theFunctionNameStringThe name of the function.
theFunctionInstanceintA unique number that differentiates one instance of the function from another instance. See Notes for more information.
theCommandshortThe name of the command for this method to perform. Setting: Typically FCICOMMAND_ RUN. See Notes for more information. Other commands can be found within the manual.
theFormFormNodePThe form that contains the function.
theComputeNode FormNodePThe node within the form that contains the function. See Notes for more information.
theArgListFormNodeP [ ]The list of arguments. See Notes for more information.
theResultFormNodePThe FormNodeP object in which the result will be stored.


Returns

Nothing, or throws a generic exception (UWIException) if an error occurs.

Notes

  • Use this method when you are calling another function from within your source code.
  • theFunctionInstance — is a unique number that differentiates one instance of the function with another instance. For example, if a form contains two calls to the function sample_package.multiply then two unique values for theFunctionInstance variable will exist.
  • theComputeNode — specifies which node in the form stores the function. For example, if you have an item such as:
  •    <label sid = "LABEL1">
          <value>sample_package.multiply("7", "6")</value>
       </label>
         

Then theComputeNode will point to the node that represents the value option.

Example

In the following example, the function my_package.multiply uses the evaluateFunctionCall method to call the sample_package.multiply function.
   public void evaluate(String thePackageName, 
      String theFunctionName, int theFunctionID, int theFunctionInstance,
      short    theCommand, com.PureEdge.xfdl.FormNodeP theForm, 
      com.PureEdge.xfdl.FormNodeP theComputeNode, 
      com.PureEdge.IFSUserDataHolder theFunctionData, 
      com.PureEdge.IFSUserDataHolder theFunctionInstanceData, 
      com.PureEdge.xfdl.FormNodeP [] theArgList, 
      com.PureEdge.xfdl.FormNodeP theResult) throws UWIException
   {
      switch (theCommand)
      {
      case FunctionCall.FCICOMMAND_RUN:
         switch(theFunctionID)
         {
         case myFC.MULTIPLY:
   /* The evaluateFunctionCall method is used here to call the
      sample_package.multiply function.  The multiply function calculates
      the result and stores it in theResult. Note that the Function Call
      Manager must be retrieved. */
            theFCM.evaluateFunctionCall("sample_Package","multiply", 
               theFunctionInstance, theCommand, theForm, theComputeNode,
               theArgList,theResult);
               
               break;
         }
         break;
         default:
         break;
      }
   }