VBCS: Action Handlers, send an email

Within VBCS, Virtual Builder Cloud Service, you can add custom actions in menus or on buttons. We will explore this feature in this blog by allowing people who visit our Tech17 application to send an email to a speaker.


Within the REST service, I added the email field, so it does now come back in the collection as well. I changed the extension and business objects accordingly, I will not cover that in this blog post.


The result of the service now looks something like this.


On the existing Speakers page, from the common section, I drag & drop a button into the list view item. On the right hand side, I select the Action tab, the hand with the arrow next to the pointing index finger.


When clicking the green ‘Add Action’ button, you see a couple of predefined actions. However, we want to do a custom action, so we click the ‘Add Custom Action’.


This brings us to the custom action screen, in where we can choose out of a lot predefined custom actions. Using this actions you can define a flow of actions that you want to happen when pressing the button. Under Miscellaneous, there is and ‘Compose Email’ option, which I drag and drop into the center.


The ‘Compose Email’ dialog will appear.


In the dialog, I can either enter data myself or we can select it. When clicking the data icon, I select the Speaker Business Object, after which the E-mail field is automatically selected, because it is configured as mail property.




It will be selected and entered in the inputfield.


After this, I add the ‘Message about the nlOUG’ as subject. I want to have a convenience in the body, by starting with the Speakers name, which I can select again from the business object.


After this, pressing Done on the top right will bring us back to the speaker page.




Now that the page is done, we can press the run icon and run the page to test our new functionality.




Pressing the ‘Send Email’ button next to my own name, opens the email client on my laptop and start a new email. It will fill the To, Subject and even the name in the start of the body!


Jarvis Pizzeria: Using an imported XSD in PCS

In the post ‘Import the 12c On-premises Preparation Process’ we saw the Business Types that were imported (also shown here)
We already stated that we had an issue with enumerations. But is this the only issue with the xsd? Unfortunately not, as will become clear soon.
Making task forms was not part of the import blog, however, in this blog we are going to do this. We will do this based on the imported xsd. So let's get started. Create a New Web Form
Give the Form a name and click the Create button.
Because the ‘Open Immediately’ check is on, the new Form opens. In the bottom right corner is the Business Types Palette. In here we see the imported Business Types that are based on the used xsd. For this form we need the PizzaPreparationBO. Drag and Drop this on the canvas.
The following form is generated. All elements of the business type are there. The ingredients are placed in a repeatable section.
Although the form is not very beautiful yet, for now, we let it be what it is. We're going to test first before we make the form look better.
Save the form and open the created process to connect the form to the tasks.
We have attached the same form to all tasks in the process. After that open the Data Association for the task. The images below show the input and output mapping used for the ‘Prepare Pizza Crust’ task.


Save and Publish the application.
Enter a comment (it’s mandatory).
Next we Deploy the application.
Details about the deployment of an application can be found in a separate Jarvis blog and starting an instance with SoapUI can be found be found in another Jarvis blog.
After running a test with SoapUI a new running instance is created. On the tasks page the first task of the running instance can be found.
Open the task by clicking on it. The task opens. But to our surprise, not all data is there. The list of ingredients is missing.
Let’s analyse this a bit further. For this go to the tracking page. The instance can also be found there.
Open it by clicking on it. The Graphical view shows that the first task is currently active.
Switch to the Tree view.
Then select the task payload (instance entered the activity). It might be a surprise but the list with ingredients is send to the task, so why is it not displayed?
Is it a bug in the used version (17.2.3)? And will it be fixed in a later release? Or is it a design decision? Only time can tell.
In a coming blog we will describe a way to overcome this issue.

VBCS: Integrate VBCS with PCS

The integration between VBCS (Visual Builder Cloud Service) & PCS (Process Cloud Service) is getting a lot better, you can now create and start processes from within VBCS. It is also possible to create a tasklist or task screens within VBCS. In this blog I will show you how to set up VBCS to be ready for these features as well as how to create a process and tasklist connected to this process. 

In the current release (17.3.5) of VBCS it is not yet possible to explore and connect to existing Process Cloud Instances. The whole process needs to be initially created from within VBCS. It also needs to be deployed from VBCS the first time, after that it can be deployed from either PCS or VBCS. After this it can be edited and adjusted within PCS. 
First we need to go to the security settings within VBCS, in the Access section, enable the basic authentication for business object REST APIs.


After that you need to go to the home page from VBCS. There is a somewhat hidden menu there on the right where an Administration option is hidden in a menu.


This brings up several Administration Options, of which some are required to fill out before VBCS & PCS are connected and integrated together. On the Tab ‘Associated Service Instances’ fill out the URL to the instance of Process Cloud.


Now we still need to go to the Allowed Origins tab to prevent CORS from happening.


To create a Process connected with VBCS, we need to go to the Business Objects under the Data Designer section. In here, there is an extra tab on the right called ‘Processes’. There is a green button to add a New Process.  
We give this a name, to recognise it within PCS, we name it ‘VBCS Process’.


After this it will show in the Processes tab on the Business Objects page.


When clicking the menu icon, you can select the Process Editor. Doing this will actually bring you to PCS and open the Process within PCS.


But before doing that, as said, we need to deploy from within VBCS first.
From the action bar we can select the ‘Deploy All’ option.


Especially the first time, the deployment might take a while.
While Deploying the button is greyed out and you can see that it is busy working on the deployment.
When the deployment is done, we can click the ‘Edit Processes’ link that brings us to PCS. The ‘Manage Process Roles’ takes you to PCS as well, but does not open the process but the security settings where you can assign users to your process roles.
Clicking the Edit link brings up the VBCS Process. In here I only have a User Task, since I want to task to be created to show up in the tasklist that we are going to build within VBCS.


Now let's start at least one instance so we have a task ready to show in the tasklist in VBCS. Here you see a running instance from our VBCS Process.


Enough about PCS, lets move back to VBCS and start working on our tasklist. In VBCS I open the Page Designer. In the components on the left hand side, there is a Process tab.


The first icon is the tasklist, when dropping this on the page a wizard will appear on the right hand side.


Here it will give you the options of selecting any of the PCS processes you created from within VBCS, this means you can have separate tasklist for different processes. Lets select the VBCS Process.
Pressing Next will bring us to the detail screen, I actually leave all the defaults on.


Clicking the green ‘Finish’ button will finish the wizard and bring up the tasklist.


As you can see, the instance that is started and waits for the human interaction is shown in the Tasklist already. In the menu, you can select actions, for this example I will press approve to see the integration with PCS working both ways.


The feedback is giving within VBCS, the action is performed. Once the fetching is done, the task will disappear from the tasklist.


Just to complete the circle, let's have a look at the instance now being completed within PCS.