Discussion:
[jboss-user] [jBPM] - How to start a process with parameters when there is no associated form?
Shane Claggett
2013-03-30 19:48:25 UTC
Permalink
Shane Claggett [https://community.jboss.org/people/sclaggett] created the discussion

"How to start a process with parameters when there is no associated form?"

To view the discussion, visit: https://community.jboss.org/message/805726#805726

--------------------------------------------------------------
What is the proper way to programmatically start a jBPM process with parameters using the REST API when the workflow has no form associated with it? I've managed to get authentication working thanks to the http://anonsvn.jboss.org/repos/riftsaw/trunk/samples/quickstart/management/src/org/jboss/riftsaw/management/ManagementClient.java this example, so I'm ready to kick off a workflow. Other posts on this forum point to two different methods to starting a process with parameters:

1. For processes that have forms associated with them, the posts https://community.jboss.org/message/751886#751886 here and https://community.jboss.org/thread/196709 here describe a method to start the process using the REST API (the gist being to render the form first, then programmatically complete it to start the process).
2. For processes that don't have forms associated with then, an older post https://community.jboss.org/message/612597#612597 here recommends modifying ProcessMgmtFacade.java to add a new REST endpoint that accepts process parameters.

Method #1 fails with the following exception if no form is associated with the process:

Servlet.service() for servlet Resteasy threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: No UI associated with PROCESS defaultPackage.TestingTaskAssignment

Method #2 may work but modifying a third-party library seem like a hack and makes me wonder if I'm approaching the problem incorrectly. What would you recommend as a solution?

Thank you,
Shane

P.S. I'm currently running jBPM 5.4.0.Final in JBoss 7.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/805726#805726]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Shane Claggett
2013-04-22 17:51:25 UTC
Permalink
Shane Claggett [https://community.jboss.org/people/sclaggett] created the discussion

"Re: How to start a process with parameters when there is no associated form?"

To view the discussion, visit: https://community.jboss.org/message/809649#809649

--------------------------------------------------------------
I figured I should answer my own question in hopes that it will help someone else in the future.

So, how should one start a process with parameters when there is no form?

The short answer: Don't. Create a form.

The longer answer: Although creating a form for a process that will always be started programmatically might seem unnecessary, it turns out to be the easiest and cleanest solution that I've found. The jBPM designer even has a handy little icon that will create a default form for you based on the process parameters. The system appears to have primarily been designed for use by humans, hence the techniques for authenticating and starting a process programmatically seem clunky. However, doing so as described in the above links works well and doesn't require hacking a third-party library.

Shane
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/809649#809649]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...