Developing a Web Application in INUBIT Workbench
You require licenses for web applications in the portal and to use the task generator! These components are not covered by the standard license. You can find example programs for all tutorials in the INUBIT software. |
Prerequisites
-
You have installed the INUBIT Process Engine & Workbench set.
-
You have added a valid license.
-
You have logged in to the INUBIT Workbench with the user miller in order to access to the example diagrams.
Workflow Management
Involving employees is often required and desirable for automated business processes.
User interaction as part of the Technical Workflow
Interactions with users are completely integrated into the Technical Workflows and are created through running workflows. The assignment of tasks arising from the process flow takes place on the basis of roles and can also be controlled using an organization diagram. This enables individual tasks to be assigned to a group of responsible parties. The organization diagram can also be used to determine a supervisor with whom a task can be escalated.
The processing of tasks takes place via a Web-based, personalized task list. A list of all tasks is displayed for each employee. This list is configured using the task generator module in an integrated WYSIWYG editor.
The list structures the tasks of the user and delivers any required additional information such as the priority of the tasks. External applications such as MS Office can also be integrated.
The task list is a JSR 168-compliant portlet and an integral part of the INUBIT Process Cockpit. It can be integrated into all other portals using the portlet standard.
Creating portals
You can also implement complete portals on the basis of the Technical Workflows and in conjunction with the task generator. The Technical Workflows define the logic required to determine the page sequence and to exchange data with back-end systems. The task generator module defines the individual pages, which also contain the portal navigation elements. The tight connection with the business process diagrams means that a portal can be created in a completely process-oriented manner with the INUBIT software.
Refer to
Developing Your Own Web Application
This section describes how to create a form-based Web application for processing orders at the car dealership.
Requirements
The portal server is activated and the portal is configured as process user server (refer to Configuring the Portal Server and refer to Connecting Process Users and Roles from Liferay).
Refer to Opening the INUBIT Enterprise Portal.
Basic procedure
-
Create a Web application as a Technical Workflow
Consisting of:
-
Web application Input Connector
This connector makes the functions of the Technical Workflow available as a portlet on the portal server. All properties that are relevant for the entire Web application, such as application permissions or timeouts, are configured on this connector.
As soon as the Web application Connector is deployed on the portal server, a portlet is generated. This portlet serves as a user interface for the Web application. In addition, all relevant information, such as application permissions, is transferred to the portal server.
-
Two task generators with the task type Form sequence/Web application page
For generating the order and feedback form.
-
One joiner and one splitter in each case.
-
Task generator with the task type Item in task list > Task
Each new order should generate an item in the task list of the responsible employee. The task list is displayed in the INUBIT Process Cockpit area on the Tasks tab. The order is submitted to the employee for approval/rejection.
-
-
Activate and publish the Technical Workflow.
Only portlets based on active Technical Workflows are displayed in the portal.
-
Deploy the portlet.
-
Assign application permissions in the portal to one or more roles.
Creating the Web Application Connector
Proceed as follows
-
Create a diagram of the type Technical Workflow.
-
Insert a Web Application Connector from the System Connector group in the sidebar into the diagram:
The module wizard opens.
-
In the first dialog, enter a name for the module.
-
Click Next.
-
Select Input Connector for Connector type.
-
Select Active for the connector.
-
Click Next.
Select INUBIT as the category and define the title of the portlet. By default, the name of the Web application Connector is used:
All portlets are grouped into categories in the portal. By specifying INUBIT, you specify that your portlet will be displayed in the INUBIT category later:
Enter a portlet ID.
-
Click Next.
-
Skip all of the subsequent dialogs and close the wizard by clicking Finish in the last dialog.
-
Insert a joiner from the Workflow Controls group in the sidebar, enter a module name and connect it with the Web application Connector.
The joiner is required to create the messages in the form of a loop so that an empty form is displayed once each order has been submitted.
Creating the Task Generator
Proceed as follows
-
Insert a task generator from the Data Converter group in the sidebar:
-
Enter the module name in the first dialog.
-
Click Next.
-
In the dialog that now appears, select Form sequence > Web application page.
-
Click Next.Skip the Permissions dialog.
-
Click Next.
-
In the XSLT Mapper settings dialog, select Ignore input message, since the input data is entered by the user directly into the form rather than coming from a previous module.
-
Click Next.
-
In the dialog Panel Layout select the layout template Table Layout.
All form elements will be arranged in a table because that makes it easier to position them.
-
Confirm with Finish. The task generator is displayed in the designer workspace.
-
-
Connect the task generator with the joiner you just added.
-
Open the context menu of the Task Generator and select Edit (in module editor).
The Task Generator > Form Mapping tab opens. In the Designer (bottom right) a small table is displayed which is represented as XML element Panel with an
orientation='table'
attribute on the Form mapping > XML target area (top):
The next sections illustrate how to create the order form with the so called order mapping on this tab.
Creating the Form Mapping 1: Inserting Labels for Input Fields
The order form should look like this:
Proceed as follows
-
Create labels for input fields:
-
Drag a label element from the form designer toolbar and drop it onto the first table cell:
The red border indicates where the label is to be inserted.
This inserts a
Label
element on the Form mapping > XML target tab. -
Click the label in the designer. A colored frame appears around the label and the properties of the label element are displayed on the Properties tab.
-
To provide text for the label, enter Company in the Specific > label line area of the Properties tab. Confirm your entry by pressing Return. The word you entered is now displayed in the designer and in the XML source/target area:
-
Repeat the procedure for inserting and naming a label for the other four label elements. Insert each label into an empty table cell. Enter an asterisk (*) after each label name. This informs users who fill in the form later on that all fields are mandatory and must be filled in.
To insert additional table rows, open the context menu for the table and select Insert row.
If you select a table row and then insert another row, the selected table row is copied. This make it easier to create elements that are required frequently.
-
-
Create input fields, name them, and mark them as mandatory fields
-
Drag a TextField element from the toolbar and place it in the empty table cell next to the Company label:
-
Insert TextField elements next to the other labels in the same way.
-
Assign names to the input fields so that they can be identified more easily when being analyzed: To do so, select the first input field and display the Properties tab. In the General area enter the value Company for the
name
attribute:Make sure that the value of the
name
attribute complies with the naming rules for XML elements. -
Select the mandatory checkbox. This marks the input field as a mandatory field.
-
Repeat the last two steps for all other input fields.
-
-
Use the context menu to delete the empty table column.
-
To display the preview, click in the INUBIT Workbench toolbar. The form should look like the following:
Creating the Form Mapping 2: Adding Buttons
Proceed as follows
You still need buttons for sending the order:
-
Insert another two table rows.
-
Drag a button element onto the form and place it in this last, empty table row.
-
Place a second button next to the first:
Pay attention to the red mark. It shows you where the second button is being placed.
-
To increase the gap between the two buttons, insert a horizontal filler between them. To define the width of the gap, select the filler and enter a pixel value for the
size
attribute in the Specific area of the Properties dialog. Example: 50 -
Select a button and display the Properties tab.
-
Name the button by entering
label=Submit
in the Specific area. -
Below this, select the
submit(value
) event, since you want the input data to be submitted when the button is pressed. -
Beneath the event, select the validate checkbox. The system will now check that all fields marked as mandatory are filled in before the Submit button is activated:
-
Assign the values
label=Cancel
andevent=cancel()
to the second button.→ The input form is now complete. In the next step, you define how data that users enter into the form is forwarded to the next module in the workflow.
Creating the Output Mapping
You use output mapping to define the data structure that is forwarded to the next module in the Technical Workflow.
Proceed as follows
-
Click to display a preview.
-
Enter data into the fields so that you can submit the form.
-
Click Submit.
The Output mapping tab appears. The XML source file area (bottom left) displays the XML data that is generated when you click Submit and sent to the task generator module:
-
In the XML structure, navigate to the Panel element and drag it from the XML source file tab diagonally upwards into the XML target area and drop it onto the template element. The structure is copied to the style sheet along with all child elements (right) and the data (left):
-
Adopt values from elements
Naturally, you do not always want to display the static data displayed top left; instead, you want to display the current values entered for the form elements.
-
To do so, delete the values displayed in the XML source area (top left): Select the cell and double-click it. Remove the value and confirm the change by pressing Return.
-
Drag the
Company
element from the XML source area (underForm > Response > Panel
) to the top left and drop it into the empty row next to theCompany
element.A context menu opens.
-
Select Assign value (value-of) from the context menu.
The XPath expression
/Form/Response/Panel/Company
is displayed in the field.Proceed in the same way for all other elements in the form. The result should look like the following:
You have now completed the output mapping.
-
-
Click to test the output mapping.
The result is displayed on the Mapping results tab (bottom right). The generated XML structure and the data is passed from the task generator to the subsequent module (the splitter) when the Technical Workflow is processed.
-
Publish the module.
Publish your module after important configuration steps such as defining form mapping. This allows you to save different work states, because a new version of the module is generated each time you publish it. You can access versions whenever you want.
Inserting Additional Modules 1: Creating a Splitter
Proceed as follows
-
Display the Technical Workflow again.
-
Insert a splitter (Workflow Control group):
The splitter duplicates incoming orders:
-
One order is forwarded to the task generator that displays the feedback form.
-
The other order is passed on to the task generator that generates a task list item.
All orders are simply forwarded by the splitter; they are not processed further.
-
-
Connect the splitter with the task generator.
Inserting Additional Modules 2: Creating a Task Generator for Order Feedback
Proceed as follows
-
Create the task generator for order feedback.
Once the order has been submitted, a short message should tell the ordering party that the order is on its way.
-
Create another task generator module.
-
Select the Form sequence > Web application page option again. The application permissions do not need to be taken into account in this module, either.
-
Select General > Ignore input message in the XSLT Mapper settings dialog.
-
Close the module wizard by choosing Finish.
-
Open the module for editing.
-
Generate the following form using a label and a button in the designer:
-
Define any output mapping, that you can freely select, e.g.:
The output message of this task generator is not used any further. Therefore, structure and content of the message are not relevant.
-
-
Display the Technical Workflow.
-
Connect modules:
-
Connect the splitter with the task generator you just created.
-
Connect the new task generator with the joiner.
This connection ensures that an empty order form is displayed to users after they click the OK button in the feedback form.
-
Inserting Additional Modules 3: Creating a Task Generator for Items in the Task List
Proceed as follows
-
Create a task generator for the item in the task list. Each new order should be displayed in the task list of the responsible employee so that the order can then be approved manually.
-
Create another task generator module.
-
Fill in the Task Generator Properties dialog as follows:
-
Click Next.
-
In the Permissions dialog, specify that the Administrator and User portal roles should be used.
This causes the task to be displayed to all owners of these roles. The task is deleted from the task list as soon as one of the role owners processes it.
Portal roles are only displayed if a portal server is active, a portal is available, and the portal is configured as process user server , refer to Configuring the Portal Server and refer to Connecting Process Users and Roles from Liferay.
-
Click Next twice and while doing so, ignore the dialog XSLT Mapper Settings.
-
In the dialog Panel Layout select the Table layout and then click Finish.
-
Open the module for editing and create the following form in the designer:
-
To ensure that the order cannot be changed, deactivate the
enabled
attribute for all labels and properties in the Misc area. -
Remember to name the display fields using the
name
attribute.
-
You can facilitate your work routine by copying the form you created in the Task Generator EnterOrder and pasting it here. |
-
Both buttons receive a
submit
event. In this case, it is important to differentiate between the two buttons. You should therefore enter the following event values:-
submit(Reject)
-
submit(Release)
Confirm your entries by pressing Return.
The event values help to identify which button was clicked. They are passed to the subsequent module once either button is clicked. Further processing of the order may depend on the event value. For example, an order with the event value Approve may be passed to the responsible department. This is not part of this tutorial.
For more information on using JavaScript, refer to Using JavaScript in Forms.
For more information on using JavaScript to submit a form when having configured a BPC portal, refer to Using JavaScript to Submit a Form in the BPC Portal.
For submission of forms in a BPC webapp, the following function can be used:x
Ext.getComponent(bpcComponentId).submit(event,namespace,url);
event
: submit event from button or nullnamespace
: namespace used in form or''
(empty)url: URL for submission
-
Inserting Additional Modules 4: Creating another Form Mapping
Proceed as follows
-
The module receives the order data from the form as an input message. You have to map this order data to the form for the task list entry. For this mapping, you need an output message from the first task generator module:
-
Display the Technical Workflow.
-
Select the first task generator.
-
Open the context menu and select Edit (in module editor). The order form is displayed in the designer.
-
Click to display a preview.
-
Fill in the fields and click Submit. The form preview closes and the Output mapping tab is displayed.
-
Test the style sheet: Click the button. The result is displayed on the Mapping results tab.
-
Click the button and copy the result to the clipboard.
-
Now, display the form for the task list entry in the Designer again.
-
Display the Source tab at the bottom left.
-
Click the button and select Open > Clipboard. The result you just copied is displayed.
-
Expand the structure.
-
Select the Company text field in the designer. The corresponding XML structure is displayed in the XML target area.
-
Drag the
Company
element from the Source tab up to the XML source area and drop it into the row to the left of theTextField
element that is formatted in bold. A context menu opens. -
Select Assign value (value-of). This specifies that the value of the
Company
element is to be displayed in the selected display field. The result should look like this: -
Repeat the last two steps for all other elements in the form.
-
Click to display the preview:
-
Click Release. The Output mapping tab appears. The XML data created when you clicked the button appears at the bottom left.
The current status of the order is identified by the attribute value
submitter=Release
of theResponse
element.If the order had been rejected, the value would be
submitter=Reject
. -
Create any kind of output mapping.
The output mapping is not required in this tutorial because the workflow ends with this module. However, an output mapping must exist or else you cannot publish the module.
Drag any element, such as a Panel element, from the XML source file tab diagonally upwards to the XML target area and drop it onto the template element.
-
Publish the module.
-
-
Display the Technical Workflow.
-
Connect the task generator you created most recently with the splitter.
-
Publish the Technical Workflow.
-
Activate the Technical Workflow by selecting it in on the Server tab, opening the context menu, and choosing Activate. The workflow symbol now appears with a colored background:
→ Your Web Application is finished. You can now add it to a portal page as a portlet.
Adding a Web Application to a Portal Page as a Portlet
In this section you learn how to add your Web Application to the INUBIT Enterprise Portal as a portlet on a new page within a password-protected area.
Deploying a Portlet into the Portal
Before you start the deployment consider the notes in the Workbench User Guide (refer to Deploying Web Applications as Portlet Archive). Before you start the re-deployment after having changed your web application particularly consider the notes under Deploying modified portlets. |
To make the web application initially available as a portlet in the portal you must deploy the portlet in the INUBIT Workbench.
Proceed as follows
-
In the INUBIT Workbench, display the Administration > General settings tab.
-
Open the configuration area Portal > Portal Deployment.
-
At the option Portlet-Archives (Administration/Deployment) click
. A dialog opens. -
Click Deploy archive and confirm the next dialog.
-
The deployment starts. After the deployment has been finished successfully, a corresponding message is displayed.
-
Close the dialog.
Adding a New Page in the Private Community Area
The portlet should be displayed on an individual page and be accessible for logged-in guests, only. Thus, you create a new page in the INUBIT Cockpit. Displaying the INUBIT Cockpit requires a login.
Proceed as follows
-
Open the portal in the web browser using the following address: https://<server>:<port>
-
Log in to the portal as root user.
-
In the portal, open the Private Pages area of the INUBIT Cockpit using the Go to Private Pages item after clicking the icon.
-
Click in the toolbar.
-
Click Add Page.
-
Enter a name for the page. Leave the other settings untouched.
-
Click Add Page to create the new page.
→ The new page is created.
Adding a Web Application
Proceed as follows
-
Display the new page to which you want to add the web application.
-
In the toolbar, click .
-
Select Applications:
The panel appears containing the available applications:
-
Click the category to which you added the portlet. That was INUBIT.
You assigned the portlet to a category when configuring the Web application Connector.
All existing portlets in the category are displayed:
-
Add your Tutorial_Order portlet and then close the Add Application panel by clicking the red X.
The portlet is displayed:
Adding Page Permissions
Proceed as follows
-
Click in the portlet title.
-
Click Permissions.
-
Set the permission View for the Power User role.
-
Save your changes.
-
Click to exit.
→ The newly created page and the portlet are now visible to all users with the role Power User that belong to the INUBIT Process Cockpit site.
Testing the Web Application
Proceed as follows
-
Fill in the form. Once you have submitted the form, the following things should occur:
The following message should appear:
On the Tasklist portlet, an order is displayed, for example:
The same task is also shown if you log in using the role Power User and display the Tasklist portlet again. This is because you have specified in the Task Generator that tasks are to be created for both the portal roles Administrator and User.
-
Click a task to display the form:
Granting Web Application Permissions, Assigning Them to Portal Roles
To control the use of your web application, you can grant special application permissions to buttons and input fields. Then, only Portal users with roles to which these application permissions were assigned in the scope of their site, are able to make use of those web application controls.
Requirements
You are logged in to the portal as an administrator.
Proceed as follows
-
In the INUBIT Workbench, display the Technical Workflow that you created in a previous chapter.
-
Open the Web application Connector for editing. The module wizard opens.
Defining Permissions
Proceed as follows
-
Click through the dialogs until you reach the Permission management dialog.
-
Beneath the display field, enter Release.
-
Click the Plus button to copy the permission to the display field:
-
Click Finish.
-
-
Publish the Web application Connector to transfer the permission you just defined to the task generator.
-
Open the last task generator for editing; this is the task generator that creates the task list entry. The task generator is selected in the module tree (left).
-
In the module tree, open the task generator context menu and select Edit properties. The module wizard opens.
-
Click through the dialogs until you reach the Permissions dialog.
-
Adopt the application permissions from the OrderForm Web Application Connector by selecting the checkbox in the Web Application Connector section. For creating the Connector refer to Developing Your Own Web Application.
-
Click Next and then click Finish to close the module wizard.
Assigning Permission to Form Element.
Assign the Release permission to the button.
Proceed as follows
-
Select the Release button.
-
Click the empty cell next to the
enabled
attribute in the Conditional area of the Properties dialog. The Select permissions dialog appears: -
Select the Release option.
-
Click OK. The dialog closes.
-
The cell now contains
{p:hasPermission($ISPortalUser, ’Release’)}
and the button has a colored border. -
From now on, the button is only active in the portal for users to whose role the permission Release is explicitly assigned.
-
Publish the module.
Re-Deploying the Portlet
Re-deploy the portlet to make the changes available.
Proceed as follows
-
In the INUBIT Workbench, display the Administration > General Settings tab.
-
Open the configuration area Portal > Portal Deployment.
-
At the option Portlet-Archive click Open . A dialog opens.
-
In the area Archives on portal server in the column Action click Redeploy archive icon.
-
Confirm the next dialog.
-
The deployment starts. A dialog with a progress bar is displayed.
-
After the deployment has been finished successfully, this dialog is closed automatically.
-
Close the dialog.
Adding Portlet Permissions
Proceed as follows
-
In the portal, display the Control Panel and open the Users > Roles section.
→ A list of all available roles is displayed.
-
Enter power in the Search field and click on Search to display the Power User role.
-
Next to the role Power User to which you want to assign application permissions for your portlet, click and choose Define Permissions. A list of all available permissions for this role is displayed.
-
Enter Tutorial_Order in the search field. The portlet is displayed.
-
Click the Tutorial_Order link.
The Application Permissions dialog displays a list of all permissions that are available for your portlet in the Action column:
-
For each action you want to allow for the role, select the checkbox. This defines the general validity area of the permissions for the Power User role.
Selecting Sites for Permission
Proceed as follows
-
To limit the scope of a permission to sites, click Change in the line with the action you want to limit to a site. A window opens that displays all available sites.
-
Click the Site to which you want to limit the action, e.g. INUBIT Cockpit. The dialog closes and the changes are accepted
-
Repeat this step to limit another action to a site. Continue in this way until you have assigned all sites to all actions.
-
-
Once you have configured all permissions, click Save to adopt your assignments. A confirmation message is displayed at the top of the window and an overview with the result of your assignments is displayed. Example:
Now, all users with the Power User role in the validity area of the INUBIT Cockpit site can approve the portlet orders. Users with the role Power User who belong to another site cannot use the Release button.
To remove a site assignment from an action, click the icon next to the site name. |
Make sure that all Technical Workflows and system connectors are active. |
Testing the Permission
Proceed as follows
-
Sign in to the portal using the portal role Administrator.
-
In the service menu, click Control Panel.
-
To the left in the Portal area, click Users. A list of all available users is displayed.
-
Next to the user James Smith who is logged in as administrator and who you want to deprive of his user role Power User, click Actions.
-
Select Edit. The window for editing user information opens.
-
In the service menu to the right, click Roles. A list of available assignments for the currently selected user is displayed.
-
Remove the role Power User by clicking the Remove button.
-
Save your changes.
If you now display the task There is a new order waiting!, the Release button is not active, because the role Administrator lacks the Release permission.
Alternatively you can create an own role and set the permissions as described. |