Direct access to logical flow in Java code in EOS

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.