Retrieve the id of a process and navigate to a new form/process on the action of a button

1
0
-1

This question may be a detailed one as I need to understand the anatomy of an application through it.

So, I have an instantiation form that shows the list of customers onboarded to our system so far; there is a "Add new customer" button which should open another form containing the onboarding formalities. I need to provide the URL of the latter form in the action of the button. I have been following the documentation to understand how to form a URL but I am not able to get the missing pieces right - namely, the processInstanceId and the taskId of the next process/form to navigate to.

Moreover, I want to know the difference between processDefinitionId and processInstanceId.
For instance, for the above case, I provide a URL like this - /bonita/portal/form/processInstance/{{processId}}/task/Basic%20information%20ingestion

I am not able to pass the processId correctly. I get an error if I run this from my studio.

Another aspect of my application is that after filling the form, I need to run a sequence of system tasks which will do some operations (business logic, DB,etc.). I already have python scripts written for these tasks, is there a way I can run those in my system tasks.

I am attaching the diagram for a visual understanding of my use case -
OnboardingDiagram.png

I need a bit of guidance to move forward as currently I am stuck on how to proceed.

Thanks in advance!

1 answer

1
0
-1

Hi,

First, let me explain the difference between processDefinitionId and processInstanceId: * processDefinitionId is the Id of a Process Definition. The process definition is the diagram you developed with the Studio and deployed in your portal (By clicking on the button Run by example). * processInstanceId is the Id of an instance of the process definition. The process instance is also called Case in Bonita.

To give you an analogy with Java. The Process Definition can be compared to a Class and the Process Instance (or Case) to an Object

For your use case "Add new customer", unfortunately, the image you attached is not available. But based on the description you gave, here is my suggestion: The instantiation form contains a button to "Add a new customer", this button action should start a new instance of your process "OnboardingDiagram". In the context of an instantiation form, a Submit button with the Action "Start process" should be enough.

Cheers

Comments

Submitted by megha on Fri, 03/31/2017 - 20:01

Thank you, Lionel for clarifying the difference.

With context to the use case where I wish to navigate to a nextStepForm from the instantiationForm, my confusion is how to form the URL for it. I am unable to provide the correct target URL for the form. I think I am probably unable to understand the linkage of processes to tasks, so can I get clarity on this using the example (customer onboarding) given above?

Notifications