Is there a URL to start a particular Process?

I have found lots of documentation on creating forms inside and outside of Camunda, but am wondering if there is a url api for starting a process inside of the task list app.

For example, in our intranet (Liferay) it might be nice to have links to kick of certain processes. Other than creating external forms and getting a URL of that, and using that to start a process, I can’t find anything in the docs for a url to start a particular process in the task list app… In the task list app, it seems to be done by javascript (I think?).

For example, in Camunda to start the Invoice Receipt process, I first make sure I am in the Task List app, then I select the “Start Process” button, and then find and choose my process, “Invoice Receipt” in this example.

Is there a way, via a URL, to jump straight into the same point as clicking “Invoice Receipt” in the last step above?

That is, a URL to show whatever form has been specified for the starting process, whether it is an embedded, generated, external or generic form.

Thanks for any help.
Regards
Colin

Hi Colin,

the Tasklist communicated with the Backend via the REST API. In this particular case, it uses the Get Start Form Key method to retrieve the path of the start form and then displays that. The process itself is then started with the Submit Start Form method.

While there is no URL to jump directly to the second page of the Start Process dialog, you can easily write a plugin that provides that functionality.

Cheers
Sebastian

Thanks Sebastian,

I shall have a look into this.

Sebastian,

I have looked at the rest API calls you listed and the plugin documentation and have captured the ajax calls being made by the task list to see how it pulls back the form from the rest API.

After seeing this I am not sure I understand your suggestion, how could I leverage these so that a URL could be processed by the camunda task list and open up a specific auto generated task form in the task list web application?

Thanks for your help,

Chris

Hi Chris,

I am not sure I understand what you are thinking of exactly. Do you want to have an URL that if it is opened in the browser opens the Tasklist and automatically shows the task form? Or a button within the tasklist that, once clicked, opens the task form for a specific process? Or something else entirely? :slight_smile:

Cheers
Sebastian

Sebastian,

I would like a URL that if it is opened in the browser opens the Tasklist and automatically shows an auto generated task form for a specific business process.

Thanks for your help,

Chris

Hi Chris,

no, it’s not possible to do that.

But writing a simple plugin could do it.

Cheers

@vale I have looked into writing a plugin but the plugin system seems to be there to add buttons and functionality to the task list in various places, I didn’t see anything that would allow me to handle new URLs types and take action on them so that I could define a type of URL that would have in it which process to open the task form for.

I am not looking to create a button that when clicked will open up a specific process task form but it needs to be a URL that will take you straight to the task form.

Can you provide any more information on how you were thinking this could be done with a plugin?

Thanks,

Chris

Hi Chris,

I’m a bit confused… I don’t see the difference between [quote=“Chris_Magnuson, post:8, topic:102”]
a button that when clicked will open up a specific process task form
[/quote]
and

Hooking in the URL handling of the Tasklist is, indeed, not possible with plugins.

A URL like http://localhost:8080/camunda/app/tasklist/default/#/?task=e94c7417-48b9-11e6-b341-a44e31a96f6c would directly display the form of a task (in the Tasklist).
Note that this URL will probably be obsolete as soon as the task is completed.

It might help if you could explain step by step what the user scenario should be.

Cheers,
Vale

Hi Vale,

I can definitely try to explain this better.

I don’t want to take the user to a task form for a specific user task in a currently started process, I need to have a URL that can take a user to the generated task form for the start event that starts the process.

Here are the steps I am thinking would occur:

  1. User would click an href link on an html page hosted by web server, say a link in a wiki article created with the wikimedia engine on a local intranet site
  2. The user would be presented with the auto generated user task form based on the formData extension elements of the bpmn startEvent

The idea is that they are not going to the task list, clicking start process, and then selecting the process name.

I need to be able to skip the got to task list, click start process, and search for process name steps by having a URL that goes directly to the form of the process I want to start.

It doesn’t have to look any different, it should still be displaying the form in the task list exactly as it would have been if they clicked start process and clicked the process name.

As an example use case I could create documentation that someone follows to do something in an ERP system and when they get to a specific step it could say click here to initiate the item change approval process.

When the click the link it takes them directly to the form to fill out hosted by the camunda task list.

The requesting user doesn’t have to be taught what camunda is, what the task list is, how to find processes, what the name of the appropriate process would be in their particular situation (maybe based on which documentation they are using we have them actually link to different item approval processes) they just need to click the link and fill out the form.

Does this make sense?

Thanks,

Chris

Hi Chris,

I did not find a way (didn’t look too long either), but ended up using the Java API to create the start form myself.

It turned out to be not that difficult, but I ended up (or plan to be - have not got back to it for a while) running Camunda on the same server as my code, so could use the Java API rather than the REST API.

Happy to share code if it is of any use.

Regards
Colin

Hi Colin,

Thanks for that information.

I am sure if you posted that code on github and lined to it here it would probably help someone who comes to look at this later on who only needs this from within java but in my case I really do need a URL as I need to link too the form to start a process from an arbitrary webpage written in various other languages.

Thanks,

Chris

Hi Chris,

I have an idea: Your link could just be the usual tasklist link with an additional URL query parameter, e.g.: localhost:8080/camunda/app/tasklist/default/#/?startProcess=my_process. You can then write a plugin that, when it is initialized, reads the complete URL and depending on whether or not the startProcess key is present in the URL opens the start process modal.

The tricky part is then to actually perform the magic to open the modal. You could either try to programatically click on the start process button and on the name of the process instance, which would be tricky as there are asynchronous requests and pagination. Or you could replicate some of the logic of the start-process dialog, which can be found on Github: https://github.com/camunda/camunda-bpm-webapp/tree/master/ui/tasklist/client/scripts/process/plugins/action/modals

Would this work for your scenario?

Cheers
Sebastian

1 Like

Hi Sebastian,

Conceptually I think the answer is yes, that should have the net effect that I am looking for.

Practically this seems like it might be brittle and error prone.

It would be really helpful if this was a feature of the product and not something I was trying to bolt on.

I will take a look at trying to implement this, thank you for the link to the code that brings up the task form, that is a hugely helpful starting point.

Thanks,

Chris

You could create a Feature Request in the Camunda BPM JIRA.

Sebastian,

That is perfect, I have gone ahead and submitted this as a feature request.

Thanks,

Chris

Thanks Chris :slight_smile:

Just a heads-up: It might take a while until a feature is actually included in the product. That’s because if Camunda decides to have it in the product it, it’s a long term commitment also including thorough testing and support. If you feel up to the task, you can speed things up by providing a pull request :wink:

Otherwise there is still the option to use the “hacky” plugin idea until it is officially supported by Camunda.

Hi Chris

I am little confuse, where to put html and js file. -

Please send me the full step in your application or camunda BPM.

Regards,
Asutosh