BSFNSpecSource

You can write a program to retrieve business function method metadata through an interface called BSFNSpecSource. The BSFNSpecSource interface defines these APIs:

  • Public BSFNMethod getBSFNMethod(String methodName) throws SpecFailureException

  • Public BSFNMethod[ ] getBSFNMethods() throws SpecFailureException

The class that implements the BSFNSpecSource interface reads the business function method metadata from an external physical repository and creates the BSFNMethod object. AbstractBSFNSpecSource is an abstract implementation of BSFNSpecSource provided by the dynamic Java connector. All customized implementations of BSFNSpecSource should be a subclass of this class. OneWorldBSFNSpecSource is the default implementation of AbstractBSFNSpecSource.

See Installing the Dynamic Java Connector.

This illustration shows the BSFNSpecSource, BSFNMethod, and BSFNParameter relationships:

Relationships among BSFNSpecSource, BSFNMethod, and BSFNParameter

This code example shows how to retrieve the BSFN spec from BSFNSpecSource:

import com.jdedwards.system.connector.dynamic.spec.source.BSFNSpecSource;
import com.jdedwards.system.connector.dynamic.spec.source.OneworldBSFNSpecSource;
import com.jdedwards.system.connector.dynamic.Connector;
import com.jdedwards.system.connector.dynamic.spec.source.*;
import com.jdedwards.system.connector.dynamic.spec.SpecFailureException;
import com.jdedwards.system.connector.dynamic.ServerFailureException;

... //Declare class
}
public void execMethod() throws SpecFailureException,ServerFailureException
{
BSFNSpecSource specSource = null;
int sessionID = Connector.getInstance().login("user", "pwd", "env","role");
//specSource = new OneWorldBSFNSpecSource(sessionID); Problem in this 
line. World should be small
specSource = new OneworldBSFNSpecSource(sessionID);
// or specSource = new ImageBSFNSpecSource("SSI.xml");
//Step 2: Get BSFNMethod by name from specSource
BSFNMethod method = specSource.getBSFNMethod("GetEffectiveAddress");
String methodName = method.getName();
System.out.println("Method name is "+methodName);
BSFNParameter[] paraList = method.getParameters();

for (int i=0; i<paraList.length;i++)
{
BSFNParameter para = paraList[i];
String name=para.getName();
System.out.println("Name is "+name);
}
}