Pages

Jarvis Pizzeria: Workaround for XSD list-element issue in WebForms

In a previous blog we have made notices that it is not possible to create a Webform based on a xsd-type that contains a list elements. In our case a list of pizza ingredients.
In this post we will give an alternative way to create a webform that displays the data, including the list of ingredients. For this we have created a new form IngredientsWebForm.
As we tried before, It does not work to drop the full business object on the canvas. Therefore, we have now made up the form of separate components. 4 input text components, of which 2 are listed in a table component and a number component that is also displayed in the table. This results in the following format.
This is the form we will use for all different presentation (one of our next posts will be about different presentation of one and the same WebForm), but first we will use it in its default. In the top left corner you see that this is the main presentation which is also the default. It is quite logically that it is the default, because it’s the only one :-)
After saving the WebForm we go back to the process to update the various tasks.
For each task we have switched the form reference to the new IngredientsWebForm. The below example shows this for the ‘Prepare Pizza Crust’ task. The example also shows that the Main presentation is selected for the task.


The next thing to do is to fix the data association between the process and the WebForm. For this, we open the Data Associations for the first task. On the input side we make the mapping of the incoming data (via the Business Object) with the fields on the IngredientsWebForm. On the output side we go the opposite way.
But first the input side.
As you can see only the transfer of source to destination is not sufficient. There is a sub-transformation required. Luckily in PCS that is not very difficult. By clicking on the redbox a menu appear with currently one option (transform). Select this.
This brings the following screen.
Click Create to create a new transformation.
Specify the name for the transformation and click Create again.
Create the mapping / transformation.
Save the transformation. This brings us back to the parent transformation. Now the redbox disappeared and the equals sign is replaced by a multi-arrow sign.


For the output side something similar is needed. We suffice with giving a couple of screenshots of one of the implementations.


The table transformation
We have repeated the association between the process and the tasks for all 4 tasks.


Now it’s time to see if this solves the issue. So let's run a test. We deployed the application and executed a SOAP test. As can be seen below, now all Ingredient details are visible.
All 4 HumanTasks in the process use the same WebForm and they all show the same data in the same way. In another post we will describe how to implement different presentations for the same WebForm in a way that every task has it’s own dedicated appearance.


When testing this functionality we ran in a minor issue in the PCS version we used (17.2.3).
On the ‘Track Instance’ page we see the newly started instance.
Select the ‘>’ sign on the right to view the details. The ‘Prepare Pizza Crust’ activity is running.
Launch the Form to see the created WebForm and then ‘APPROVE’ it, or directly select ‘APPROVE’. Both is possible. It doesn't matter which one you choose to get the problem visible.


In the image below you can see that the Graphical view moved on to the next task in the process flow, while the open activities is still on the first task.

A simple refresh is required to get the right task available. It is just a tiny problem but quite annoying in use. So hopefully it will be fixed in the next release.

No comments:

Post a Comment