JBPM 6.2. How to deploy a workflow directly from Eclipse instead of KIE workbench?

狂风中的少年 提交于 2019-12-06 14:32:35

问题


I am using Eclipse Luna and WildFly 8.1 with JBPM 6.2. Currently, my Eclipse is configured so that I can start both the WildFly 8.1 server and the KIE workbench directly from within Eclipse.

Previously, I had created an Evaluation.bpmn workflow from the KIE workbench and was able to succesfully deploy it and see the workflow logs in the database tables.

However, is there a way to create a JBPM project in Eclipse and deploy and start the workflow directly from Eclipse? If so, how can I do it?


回答1:


This isn't deploying from eclipse. The best way is:

  1. Create a m2e project mentioned by @jl987
  2. Create a junit test
  3. In junit before class, use the jbpm rest api to deploy your maven artifact
  4. In junit test method execute and validate results of workflow with rest api.

    The rest api can be found at: API

    There is also a maven rest client in kie-remote: Client




回答2:


Another way to access and modify projects from the workbench is to clone the built-in Git repository.

There are a couple of different ways to go about it, but I'm going to describe the one that is most useful for a BPM server with many projects that you might want to work with or not, but want to have locally just in case.

The alternative methods are quite similar as the main concept is to clone a project from KIE Workbench locally and import it into Eclipse.

First, get some info from KIE workbench:

  1. In the workbench, go to Authoring -> Administration menu, and if not displayed by default, click on Repositories -> List in the menu bar below that.

  2. Locate the repository containing your project and click the desired access protocol link in the General Information pane on the right hand side (ssh will probably work best).

  3. Copy the repository URI to clipboard.

Next, clone the Git repository and import it as a general project:

  1. In Eclipse (or JBoss Developer Studio), create a clone of that Git repository by selecting File -> Import -> Git -> Projects from Git and click Next.

  2. In repository selection dialog, select Clone URI and click Next.

  3. In Source Git Repository dialog, paste the URI you copied from the workbench and enter your workbench username and password, then click Next.

  4. Confirm the host key and select the branch(es) you want to clone (probably just master). Click Next.

  5. Select a place you want to clone the Git repository to and click Next. (It does not have to be in your workspace, but you will be working directly on that copy, so place it somewhere where you keep your projects.)

  6. In the import wizard selection dialog, select Import as a general project, click Next and give it a name, for example "My KIE repository". Click Finish.

Finally, just import an existing Maven project from that clone:

  1. Select File -> Import -> Maven -> Existing Maven Projects and click Next.

  2. In the Maven Projects dialog, click Browse and point it to the location of the project inside your cloned Git repository.

  3. Make sure a pom.xml is displayed, with the project coordinates describing the group ID, the artifact ID and the version of the project you want to import and work on.

  4. Click Finish.

If your maven repositories are configured correctly, that should be it.

You might have to add an external repository where org.kie:kie-maven-plugin can be found, because the packaging of KIE Workbench projects is set to kjar, which is implemented by that build plugin.

Afterwards, just work on that project as if it were any normal Maven project. Test it in your workspace, manipulate process diagrams, whatever. Whenever you want to publish it in the KIE server, just right-click it and select Team -> Push to Upstream.

If you want to refresh your project with any changes that might have happened in KIE Workbench in the mean time, do the opposite, Team -> Fetch from Upstream.

Of course, pushing the changes to origin will not automatically build and deploy the project, for that you still have to log in and do it manually, or do it using the REST api.




回答3:


To deploy a workflow directly from Eclipse, first create a JBPM Maven project within Eclipse. Perform "mvn install" on a command line or through the Eclipse m2e plugin.

Now go to your KIE workbench. Select "Deploy" tab, "Process Deployments," and click the plus sign on the left. Fill out the Group ID, Artifact, and Version. Click "Deploy Unit".



来源:https://stackoverflow.com/questions/29130841/jbpm-6-2-how-to-deploy-a-workflow-directly-from-eclipse-instead-of-kie-workbenc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!