添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hi all

We are developing an optimization script in Python while having some resources limitation, so we don’t have a resource to host this optimization service.

Is there a way to host this python script as a flow service at the integration server?

You can’t run it inside java, but you could call it via a java service e.g.

String run = "cmd /c python duplicatetestingoriginal.py" ;
    boolean isCreated = fwr.writeFile(BugFile, GD, 500, true, 5, "LET");
    if(isCreated){
            r = Runtime.getRuntime();
            p = r.exec(run);
            BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    String line = "";
    while ((line = stdInput.readLine()) != null) {
                System.out.println(line);
    while ((line = stdError.readLine()) != null) {
               errorW.write(line);
            int exitVal = p.waitFor();
            arrayList = fwr.readResults();
        }catch(Exception e){
    else{
        // troubleshoot....

or you could try rewriting it into a java service e.g.

Online Python to Java Converter | JavaInUse

Online tool to convert Python to Java. Complex Python Code can be converted to Java using this tool. Java and Python are the two most popular programming languages. Both are high-level, general-purpose, widely used programming languages.

We have a BPM implementation.

In one of the processes we need to do some optimization logic, which we developed a python script to do and wanted to host this python script as a flow service.



Mohammed Alshehri

A question.
Would it make sense to create an API in Python that runs the script based on input and returns output? It would need to run as a separate process and then invoke the API over HTTP/S from IS/BPM.

Compared to embeding it into the code you may find API approahc more elegent. Plus API code can be updated without having to change BPM.

It may take you more effort upfront, but will keep solution flexible.

Exactly,

This is what we are doing currently, but we were trying to host it within IS as we have some infrastructure resources limitations and didn’t prefer to run other applications on the same machine hosting the IS

Best regards,
Mohammed Alshehri