Read the original
direct access to logical flows in Java code
In Java code, you can invoke all logical flows, both public and private.
Description
Direct access to the logical stream in Java code cannot be separated from the eosserver environment, for example, in a separate main function.
In some scenarios, you need to access the logical stream directly in Java code, and you can do this by following these steps: Getting the logical Flow widget instance
Com.eos.engine.component.ILogicComponent comp = com.primeton.ext.engine.component.LogicComponentFactory.create (" Logical component Full name ");
Logical component full name such as: Com.primeton.samples.base.logicflow.ScoreManager invoke logical flow through logical flow widget?
| object[] params = new Object[size]; assign params ' value; ...... object[] returnvalues = Comp.invoke (logicname, params); Process return Values |
code example: See the example in Com.primeton.samples.base.logicflow.javaCall.JavaCallLogic.java.?
| /** * Invoke logical widget Scoremanager the following logical flow sendemail * * need to prepare input parameters for logical flow, return value is a object[] * * @return object[] * @throws throwable / public object[] Calllogicbusiness () throws Throwable { object[] result = NULL; //Logical component name String ComponentName = "Com.primeton.samples.base.logicflow.ScoreManager"; //Logical flow name String OperationName = "SendEmail"; ilogiccomponent logiccomponent = logiccomponentfactory Create (componentname); int size = 1; //Logical Flow Input Parameters object[] params = new Object[size]; params[0] = new Customer (); result = Logiccomponent.invoke (OperationName, params); //Logical stream return value return result; } |
Description
The 2nd parameter in the Ilogiccomponent invoke method params the array needs to match the number and type of input parameters defined in the logical stream.