Flow creation using java

I would like to write a java service that can create package, folder structure and Flow Service including try-catch block with common exception handling services ,under the catch block with common input and output. Is there any other ways to achieve this.

I have tried to create the flow service from java using below post but didn’t work.

Refer to my answer to a similar Stack Overflow question, where I describe a couple of ways you can create a new package programatically: http://stackoverflow.com/questions/20104411/package-creation-in-webmethods/20133559#20133559.

Also, since you want to create a flow service already populated with code (my answer on the post you link to only creates a new empty flow service), I would suggest you instead use file based approach to creating services as follows:

  • Create a template service that includes the code that you need, and copy/save the resulting flow.xml and node.ndf files from the relevant ./packages//ns/// directory - these files are the template files you will use to create new services.
  • Create a new “create service from template” service that takes in the fully-qualified name of a new service to create and the package to create it: then code it to create the package if it doesn’t already exist (using one of the techniques from my Stack Overflow answer), create a new directory for the required new service in the relevant ./packages//ns/ directory, then write your template flow.xml and node.ndf files to that directory, then reload the affected package.

Hi Lachlan,

Thanks for the reply, I have already created the package and folder structure using the wmRoot services with the help of the Stack Overflow post that you have mentioned above. In my case I have more than one template, Is there any other way other than copying the flow.xml and node.ndf files to add the flow steps in the flow service.

Suresh Kumar M