Bonitasoft bpm custom widget output binding - binding

I use Bonita Community Edition Version : 2022.1 on MacOS Monterey
I developed a simple process, with business object / data / variable, a web form input with contracts, etc.
The form is containing :
Bonita auto generated fields auto binded to the business object
a custom widget because I wanted to update some fields when the user type input other fields (auto calculation). It’s composed of 6 fields which interact between them. It’s working fine.
The issue is coming when I try to bind the custom fields to the business object. The data from the Bonita auto generated fields are saved in the DB but the custom fields.
I really tried to deep dive into official forum, stack, google and other but I couldn’t find any documentation or example on how the binding is done with the custom widget output.
I need help please.

Related

Form settings validation (application and form name uniqueness)

From the Orbeon documentation:
Application Name. Each form definition has an application name which identifies a group of forms that belong together. In practice, an application name might correspond to a project, or a department, or a company. For example, all forms built by Orbeon have the "orbeon" application name.
NOTE: Depending on your permissions, the application name might have been picked for you already, or you might have the choice of a restricted set of application names.
Form Name. Each form definition also has a form name, which identifies a unique form name within a particular application.
As orbeon's persistence API retrieves the form definitions by their application and form name, I would like to put some validation to the form settings page that would prevent the user to save a second from definition with the same application and form name as an existing one.
(My first approach would be to put some custom response to the persistence layer, but orbeon is not able to make difference between a general persistence error and a validation errror there with other words the backpropagation of the errors of the persistence layer/api to the user is not that mature, so to say.)
So how should I do this?
If I understand correctly, you'd like Form Builder users to be prevented from creating a new form with an app/form name that is already used. The user could either be prevented from creating that form, or at least offered the option of opening the existing form instead of creating a new one with the same app/form name.
One question would be what, in that context, "already used" means: are we talking about forms editable by that user in Form Builder, or published forms? Maybe Form Builder should check both.
This check should happen in 3 places in Form Builder:
When the form is initially created (better warn users as soon as possible).
When users open the form settings dialogue to rename the form.
When saving (even if we're sure no form with the same app/name existed at the time the form was created, in the meantime another form with the same app/name might have been created).
In situation number one, if a form with the same app/name exists in Form Builder, Form Builder should provide the user the option to open that form instead of creating a new form.
So this is a feature that should be implemented at the level of Form Builder; it cannot be done solely by a custom implementation of the persistence API. This is covered by request for enhancement #818.

Delphi create User form

I am making a user form in Delphi for documents tracking application. I am interested in functionalities input new entry (record) and view list by... (date, name of document, ID,...).
My problem is that I don't know how to implement these functionalities for more than one user. Currently, I have 5 users. Each user has a unique input data (record) fields (columns) and view fields (columns) of each user are also unique. There could be more users.
So, how to implement these functionalities for this form? How to assign different data (fields) for each separate user for input and view? That is what I don't understand. Is that distributed functionality of an application? If yes, how to achieve it?
Note that I don't want static assigning of a user in application's code, e.g:
if(username='user1') then {
input();
view();
}
else if (username='user2') then {...}
...
because, than, every time there is a new user, developer must go back to the application's code and hard-code it. That is not efficient and is a bad implementation. Rather, I want that to be dynamic (if that is the right term). How to achieve this?
Note: I am using dbExpress tool with MySQL DBMS with RAD Studio XE7 Architect.
If I'm correctly understanding what you are asking, it seems as if you are unfamiliar with the idea of tables/datasets which operate in a so-called Master-Detail relationship. These are very easy to set up in Delphi.
Once you get familar with M->D relationships, I think you'll realise that what you should have been asking about is how to set one up in your app, rather than the problem of hard-coding of individual users into your form.
In your case, what you are missing at the moment is a table of users' details. Let's call that the Users table. Usually this would contain their name, obviously, and some kind of unique identifier (best is a "Primary key" in the Users database table), but NOT, please, their password to access the db, especially not in plain text.
Once your Users table is created, you can create a display grid (TDBGrid) and input/editing form for it.
Then, if you don't have it already, you could set up a grid and editing form for users' documents (which I'm going to refer to as the Documents table).
Once that's done, the main thing left to do is to set up in your Delphi project a Master-Detail relationship between your Users table (the master) and your Documents table (the detail).
If you prefer you can have a single form with two grids, the Users grid and the Documents grid on it, and as you scroll through the Users grid, you'll see that the Documents grid shows only their document records.
The details of how to set up a Master-Detail vary somewhat according to the type of table/dataset you're using so you'll need to search online for the details of how to do it. Broadly, it's a matter of connecting a TDataSource to your Users table and setting the DataSource (or MasterSource) property of your Documents table to point at the Users TDataSource, and then setting a couple of other, table-type-dependent properties of the Documents table.
Every edition of Delphi since well before D7 has come with a demo app, "MastApp" which illustrates how you use Master-Detail relationship amongst a number of tables. I suggest you take a look at the MastApp for your Delphi version and then look into how to set up M->D relationships for the type of Delphi dataset you are actually using.

Generate a table in the UI Designer from a local variable and from business variable

I have a connector that selects data from an external database in Bonitasoft, I was able to assign the result of this select to a process variable and display the contents of that variable in the UI Designer in an Input type field, however I need to display this in a table, as I configure This in the UI Designer to display the contents of my process variable in a table, if possible show the step by step thank you. Another thing as I can also pass the contents of my connector to a business variable and then display in UI Designer also if needed
First of all I want to draw your attention that using business or process variables to store data already stored in an external database will lead to duplication.
Recommended solution would be to use a REST API extension (such as REST API SQL data source) to query the data from the external database and use this REST API extension in the forms.
Now if you are ok with duplication of data you can refer to an example I create that demonstrate how to set process and business data with PostgreSQL connector output and then display the variables in form table widgets.
I highly recommend to use business variable and if possible consider migrating the data from the external database to the business data database.

Component published property as array of TQuery

i'm developing a custom component, and i'd like to add a published property that would be an array of TQuery (it should be visible in the object inspector). the main feature would be to drop the component on a form and then visually select the queries that are present on the same form, or on any other project form.
is that doable? from what i've seen till now, you can only programatically use such an array property...
UPDATE
first, thanks for your answer Alex!
second, the chatch is that i have to modify an old app someone else created, so i want to tangle with it as little as possible (actually there's a second app i need to "fix" which i was told is twice as big). now for the details: the app has abou 15 forms for various db operations. as you can imagine each form has 2-3 TQuery objects. the problem is that the user must authenticate with the db in order to execute the queries, thus he knows the db user & pwd which is a security flow.
in order to avoid this, an intermediate system has been introduced. one connects & authenticates with it and requests the necessary db data: user, pwd, and database name. my job is to use this system and autologin to the db. the necessary credentials to access this intermediate system are not considered a security flow so i'll read them from an inifile that depends on the environment where it's deployed: test, pre-production, production.
so i placed a TDatabase component on my form, setting its LoginPrompt property to FALSE. the tricky part however is adjusting each TQuery to the diferent database name for each environment before execution..
dunno if i made myself clear but it's the simplest explaination i managed to come up with
thanks,
G
To make life as simple as possible, you may have to grin and bear it once:
Create a datamodule and make sure it gets instantiated before the main form.
Put your TDatabase component on that data module.
Go through all your forms once and
add the database's data module to its uses clause (can be in implementation section).
Change all your TQuery and other database related components once to use the database component from the data module instead of having their own connection strings.
At run time, login as you described via your TDatabase component et voila, all your components will now use these settings automagically (as they are all connected to your TDatabase instance).
Okay, you've added a TDatabase to your project. Now, fill the "DatabaseName" property of TDatabase with some random name. Every TQuery component in your project also has a "DatabaseName" property and fill in the same name in those properties! Now your database and all it's queries will be connected and you could use the TDatabase object to access them all.
Yes, it can be done but you will have to write your own Property editor with it's own input form to manage the data inside the array. There's plenty of information to be found online. And yes, you could create a component that checks for controls on it's parent, allowing you to access those.
But is it practical? Why do you need an array of TQuery components in design time? Maybe you need to rethink your design first, so you're absolutely sure that you need this functionality. (Besides, what's wrong with using a Data Module to contain your queries?)

ASP MVC Creating Form Rows Dynamically

I haven't even attempted this yet and am creating this question for advice really.
I have a strongly typed page which receives a form model composed of several components. It is to create a mitigating circumstance (MC) for a student at a university for my final year project. A MC can be composed of the initial problem, assessment extensions, and I use a multi select box to allow the user to select staff retrieved from the database which are able to view the MC once created.
The thing is I feel that a student could be granted many assignment extensions for one problem. I am wander if it is possible to include a button/image on the form which when clicked will create a new assessment extension object, and duplicate the form components to set the values for the object? This would all need to occur without any page refreshes.
Any advice, or links to good tutorials would be appreciated. I have so far been unable to find any suitable examples.
Thanks,
Jon
There are a number of ways to do this, but the fastest is to create a javascript handler which creates the form controls without any sort of server request, all you need to do is keep track of how many items are in your list so you can name the form controls correctly.
Start by making a button that when you click on it creates form controls. Once you get that, work on the naming.

Resources