BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  IBM Baw Jar development

    Posted Thu March 09, 2023 09:41 AM

    Hello,

    I want to develop a jar file for IBM BAW. I developed a jar file and called in process but parameter names seems parameter1, parameter2.

    How can I develop jar file so that parameter names seem like name, surname?

    Thanks for your help.



    ------------------------------
    YASEMİN ALADI
    ------------------------------


  • 2.  RE: IBM Baw Jar development

    Posted Fri March 10, 2023 02:26 AM

    Hi @YASEMİN ALADI , please have a look at https://www.ibm.com/docs/en/baw/22.x?topic=service-invoking-java 


    Tip: Because Java method signatures that are inspected in complied classes do not contain information about the parameter names, generic names and numbers are generated for them, for example, Parameter 1 (String), Parameter 2 (Integer). You can add BeanInfo classes that provide additional information about the classes and their methods.

    You need to provide BeanInfo classes in the jar file such that BAW knows the name of the parameters. See https://docs.oracle.com/javase/8/docs/api/java/beans/BeanInfo.html, https://docs.oracle.com/javase/8/docs/api/java/beans/MethodDescriptor.html, https://docs.oracle.com/javase/8/docs/api/java/beans/ParameterDescriptor.html

    With those you describe what the parameter names are.



    ------------------------------
    Maximilian Tews
    ------------------------------



  • 3.  RE: IBM Baw Jar development

    Posted Fri November 15, 2024 10:27 AM

    Hi @Maximilian Tews I tried this by providing BeanInfo to my jar still same getting Parameter1 ,Parameter2..I even tried Compilation option from eclipse IDE which was mentioned in some other post but still same .



    ------------------------------
    Owais Iskhab
    ------------------------------



  • 4.  RE: IBM Baw Jar development

    Posted Fri November 15, 2024 11:41 AM

    if your class is:

    package yourpackage;

    public class YourClass {

    public String doSomething(String key, String value) {

    return key+"-"+value;

    }

    }

    ...than your BeanInfo class can look like below:

    package yourpackage;

    import teamworks.TWBeanInfo;

    public class YourClassBeanInfo extends TWBeanInfo {

    private static Class<YourClass> beanClass = YourClass.class;

    private static MethodInfo[] yourClassBeanInfoMethods = new MethodInfo[1];

    public YourClassBeanInfo() {

    super(yourClassBeanInfoMethods);

    }

    public Class<YourClass> getBeanClass() {

    return beanClass;

    }

    static {

    yourClassBeanInfoMethods[0] = new MethodInfo(beanClass, "doSomething", "doSomething(String, String)");

    yourClassBeanInfoMethods[0].addArgument(String.class, "key");

    yourClassBeanInfoMethods[0].addArgument(String.class, "value");

    }

    }



    ------------------------------
    Sebastian Tylko
    ------------------------------



  • 5.  RE: IBM Baw Jar development

    Posted Tue November 19, 2024 01:57 AM

    Dear @Sebastian Tylko still same behavior , tried the above one.



    ------------------------------
    Owais Iskhab
    ------------------------------



  • 6.  RE: IBM Baw Jar development

    Posted Tue November 19, 2024 05:00 AM

    Maybe you have this class implemented twice in different jars? Than you don't have control which implementation loads first (despite you select specific jar during external service creation). 
    My example depends on internal  BAW class  TWBeanInfo - so you have to add to classpath: <BAW_root>/BPM/Lombardi/lib/ps.jar  during compilation. Using TWBeanInfo helper makes this task little bit easier.  But as Maximilian Tews  already said in this thread - you can just implement standard getMethodDescriptors()  from BeanInfo interface e.g. by  using  SimpleBeanInfo. In that case you don't need IBM provided classes.
    Both approaches should work fine. I tested my example on BAW 24.0.0 - but it should work on any BAW. 



    ------------------------------
    Sebastian Tylko
    ------------------------------