Examples

Simple Read, Write and View Design

Select the business object in the Configure tab. To design a model, to enter data and view data, following should be the model design.


Figure: Enter and View Data

Working with Activity Groups and Spawning a Process

The following example helps you to understand how to work with activity groups and create multiple instances of a process.

In this example, we are defining two structured data named Product and Vendor and mark them as business object with relationships between them. Then, we are creating business object instances for these data. We need to initiate associated process with Vendor data object. Once the process is initiated, multiple instances of the process with same business objects are created. To start with:

  1. Create a model named bomodel in the Modeling perspective
  2. Create structured types named Product and Vendor in the bomodel
  3. Define ProductID of type Text in the Vendor structure type. Note the cardinality of each field.


    Figure: Vendor

  4. Define VendorID of type Text in the Product structure type. Note the cardinality of each field.


    Figure: Product

  5. Create structured data named ProductData and VendorData
  6. Define primary key for ProductData as shown in the following screenshot:


    Figure: ProductData - Primary Key

  7. Define primary key for VendorData as shown in the following screenshot:


    Figure: VendorData - Primary Key

  8. To establish relationship between VendorData and ProductData, define relationship in the VendorData as shown in the following screenshot:


    Figure: VendorData - Relationship

  9. Open the ProductData to view the automatically created relationship


    Figure: ProductData - Relationship

  10. Deploy the model in the Modeling perspective
  11. Switch to Model & Go! perspective
  12. Create a model named multinstance-demo in the Model & Go! perspective
  13. In the Configure tab, select VendorData as the business object


    Figure: Configure

  14. In the Model tab, add user task and select implementation as VendorData Entry Screen (Read/Write) as shown in the following screenshot:


    Figure: User Task - Implementation

  15. Add activity group and set Spawn Processing option as Products of VendorData


    Figure: Activity Group - Spawn Process

  16. Add user task to activity group and set implementation as Product Data Entry Screen (Read/Write)


    Figure: Activity Group - User Task

  17. Add another user task to activity group and set implementation as Product Data Review Screen(Read-only)


    Figure: Activity Group - User Task

  18. Add user task under activity group and set implementation as Vendor Data Review Screen(Read-only). Note that this user task is outside of activity group.


    Figure: Vendor Data Review

  19. Deploy the model
  20. Switch to Control Center perspective
  21. Open the Business Object Management panel


    Figure: Business Object Management

  22. Add instances for the VendorData business object


    Figure: Instances for VendorData

  23. Add instances for the Product Data business object


    Figure: Instances for Product Data

  24. Associate three product instances with VendorData business object ACME


    Figure: Related Business Objects with VendorData - ACME

  25. Switch to Model & Go! perspective
  26. In the My Processes panel, click Start Process


    Figure: Start Process

  27. For VendorData business object, select the vendor with ID ACME


    Figure: VendorData ID - ACME

  28. Startable processes for the ACME instance gets displayed


    Figure: Startable Process for ACME instance

  29. In the Startable Processes pane, click Start Process. Specifying startable processes parameters is optional.


    Figure: Startable Process for ACME instance - Click Start Process

  30. Note that the one process should be started and the same message should be displayed at the top of the dialog.


    Figure: One Process Started

  31. Switch to Workflow Execution perspective and refresh the My Assignment panel. It should display one item assigned to the user.


    Figure: My Assignments

  32. Initiate the process from My Assignments panel. The activity gets displayed in the worklist view.


    Figure: Worklist View

  33. Click on the Enter Vendor Data activity to activate the process. It should display the Product data which you have associated with the VendorData object instance called ACME in the Business Object Management view. Here you can see the three values of ProductData. It should create three instances of ProductData that is three processes.


    Figure: Enter Vendor Data

  34. Complete the Enter Vendor Data activity
  35. The first instance of the product data gets displayed. Complete the Product Data Entry activity. Note that this is a subprocess.


    Figure: Product Data Entry

  36. Complete the Product Data Review activity


    Figure: Product Data Review

  37. Refresh the My Assignments panel


    Figure: My Assignments

  38. Remaining two process instances are displayed in the Worklist view.


    Figure: Two Spawned Process instances

  39. Complete these two instances of the process
  40. Note that the Vendor Data Review activity displays all three instances of the spawned process.


    Figure: Vendor Data Review

Working with Error Tasks

In the following example, we are creating a Javascript application with wrong configuration for the parameter named LastName as LName. At the time of execution, the same exception is caught and displayed under the Review Task tab.

  1. Perform the following steps in the Modeling perspective.
  2. Create a structured type named Person as shown in the following screenshot:


    Figure: Structured Type - Person

  3. Create structured data named Person and define it as a business object
  4. Create a Javascript application with following configuration:


    Figure: Javascript Application - Configuration

  5. Switch to Model & Go! perspective
  6. Create a model with Person business object:


    Figure: Configure

  7. Add a user task as shown in the following screenshot:


    Figure: User Task

  8. Add a service task as shown in the following screenshot:


    Figure: Service Task

  9. Add an error task as shown in the following screenshot. Note the exception implementation.


    Figure: Error Task

  10. Deploy the model.
  11. Switch to the Workflow Execution perspective.
  12. Start the process.
  13. Enter first name and last name and complete the activity.


    Figure: Enter Name

  14. In the Review Task activity, the name is displayed under the Person panel


    Figure: Review Task - Person tab

  15. The Review Task tab displays the error text.


    Figure: Review Task - Review Task tab

Implementation - Error flow template defined in the Modeling perspective

First, we need to provide a process interface with one string type parameter and one boolean type out parameter. Then, create an application which would throw the exception based on the process interface. So, let's start:

  1. In the Modeling perspective, create a model.
  2. Create a primitive data named Error Message of type Text.
  3. Create a primitive data named Retry of type Boolean.
  4. Create a Javascript application named Exception Script.
  5. In the Configuration tab, specify the following script:
    throw "Code: 1, Error";
  6. Create a process named Error Handler.
  7. Assign participant to the process.
  8. Add a manual task named Exception Flow Activity.
  9. Specify input mapping of an Error Message data with the Exception Flow Activity.
  10. Specify input and output mapping of the Retry data with the Exception Flow Activity.


    Figure: Error Handler - Process

  11. Open the properties of the Error Handler process.
  12. In the Process Interface property, select the Provides Process Interface type.
  13. Create two parameters of the process interface as shown in the following screenshot:


    Figure: Provides Process Interface - Parameters

  14. Create another process named Exception Process.
  15. Assign participant to the process.
  16. Add a manual task named Exception Test Activity 1.
  17. Drag and drop the application Exception Script in this process.
  18. Connect the above two activities. The process diagram would look like as shown in the following screenshot:


    Figure: Exception Process

  19. Deploy the model.
  20. In the Model & Go! perspective, create a model named Error Flow.
  21. Add a User Task in the model and select Checklist Panel from the Implementation drop-down list.
  22. Add Checkbox/Boolean as Input Type.
  23. Add a Service Task to the model.
  24. Select Exception Script from the Implementation drop-down list.
  25. Add an Error Task under the Service Task.
  26. Select General (java.lang.Exception) from the Perform If drop-down list.
  27. Select Exception Test/Error Handler from the Implementation drop-down list.


    Figure: Exception Process

  28. Save and deploy the model.
  29. In the Workflow Execution perspective, start the process Error Flow.
  30. Complete the User Task 1 activity.
  31. Note that the Exception Flow Activity is displayed and the Error Message field displays the exception.


    Figure: Exception Flow Activity

  32. If you select Retry check box and Complete the activity, then again the same activity is executed.

Work Completion Event

In this example, the work completion event triggers the process named Fund. The work completion event is triggered when the ID of the business object named Product matches with the ID of the business object named Fund.

  1. Create a model in the Modeling perspective named Bostart
  2. In the Bostart model, create a business object named Product and specify ID as the primary key
  3. Create a process as shown in the following screenshot:


    Figure: Modeling - Process

  4. Create a model in the Modeling perspective named Demo
  5. In the Bostart model, create a business object named Funds and specify ID as the primary key
  6. Deploy both the models
  7. In the Model & Go! perspective, create a model called Event that uses the Funds business object


    Figure: Model & Go! - Configure

  8. In the Model tab, add a user task that implements Funds Entry Screen (Read/Write) as shown in the following screenshot


    Figure: Model & Go! - User Task

  9. Add the event and specify implementation as Work Completion


    Figure: Model & Go! - User Task

  10. Add the user task to view the funds details


    Figure: Model & Go! - User Task

  11. Deploy the model
  12. In the Workflow execution perspective, under My Startable Processes, activate the Events process
  13. Specify the Fund ID and Name and complete the process. Note that once you complete the process, the event goes in Hibernated state as it is waiting for next matching ID process to get completed.


    Figure: Specify Fund Details

  14. Activate the BOprocess and specify matching ID provided in the Events process


    Figure: Specify Matching ID

  15. Complete the process. After completion of this process, the hibernated event becomes active and gets triggered. Then, the next process gets executed.
  16. In the Worklist, click the show process and view that the data of the first process is displayed.


    Figure: View Data

Checklist Panel - Quality Assurance

The following example helps you to understand how to work with quality assurance activity.

Creating a Web-based Model for Quality Assurance

Following are the highlights of the web-based model. This model contains two activities:

The Create Account activity has the Quality Assurance property set. It checks whether the account number and the account name values are specified properly. If these values are left blank or not provided in the correct format then the activity goes to the Quality Assurance worklist. The Accountant and QA Operator roles are created and the user should be assigned to these roles.

Creating the Workflow

First create the workflow of the model:

  1. Create a process called QAUseFormula
  2. Create two roles Accountant and QA Operator
  3. Create a structured data named Account and declare it as a business object.
  4. Click on the process to open its diagram canvas
  5. Click on the default lane to open its properties pane and select Accountant as a participant.

    Participant

  6. Create a start event followed by a manual activity, Create Account.
  7. Drag the structured data to the lane
  8. Create In- and Out-data-mappings for both data to activity Create Account.
  9. Create a new lane and select QA Operator as a participant.
  10. In this lane create a subsequent manual activity, Next Activity.

The workflow should now look like as shown in the following diagram:

Diagram
Figure: Diagram with created workflow.

Setting Quality Assurance Criteria

Now set the criteria for quality assurance in the property page of activity Create Account:

  1. Click the QA icon on the left side of the pane to open the Quality Assurance properties.
  2. In the Quality Assurance pane, choose role QA Operator from the drop-down list as a QA Participant.
  3. Leave the probability value as 100%.
  4. Enter the following formula:
    var accnr=Account.AccountNumber;
    var accname=Account.AccountName;
    if ( (accnr > 9999) || (accnr < 1000))
    {
        true;
    }
    else if ( accname == null )
    {
        true;
    }
    else 
    {
        false;
    }


Figure: Quality Assurance Criteria

Creating a Simple Model for Quality Assurance

  1. Create a simple model called QA
  2. In the Configure tab, select Account from the Business Object drop-down list


    Figure: Business Object - Account

  3. In the Model tab, drag and drop two user tasks to the steps pallete
  4. Set the Checker as an Accountant for the first user task


    Figure: User Task - Checker - Accountant

  5. In the second user task, specify the Checker as a QA Operator


    Figure: User Task - Checker - QA Operator

  6. Deploy the model

Executing the Workflow of Quality Assurance Activities

  1. Login as administrator (motu/motu)
  2. Switch to the Participant Manager View of the Administration Perspective.
  3. Create Accountant and QA Operator roles
  4. Assign the user James and Jones to these roles, respectively
  5. Switch to the Workflow Execution perspective
  6. Start the QA process from the My Startable Processes
  7. Do not fill the values in the Account Name and Account Number field and complete the user task
  8. Logout and login as James and open the worklist.


    Figure: User Task - Checker - QA Operator

  9. Activate the User Task 1
  10. Fill in the appropriate values and click the Pass Quality Assurance icon


    Figure: User Task - Pass Quality Assurance

  11. Click Yes and add a note in the Pass Quality Assurance dialog.


    Figure: Pass Quality Assurance

  12. Click Ok
  13. Login as administrator (motu/motu) and open the worklist of motu.
  14. Activate and complete the User Task 2.
  15. Logout and login as Jones and open the worklist.


    Figure: Pass Quality Assurance

  16. Activate the User Task 2
  17. Fill the appropriate values
  18. Click the Pass icon


    Figure: Checklist Panel - Pass Icon

  19. Click Yes and add a note in the Pass Quality Assurance dialog.


    Figure: Pass Quality Assurance

  20. Click Ok

For more information, please refer to chapter Executing Quality Assurance Activities Executing Quality Assurance Activities of the Infinity Process Platform Portal Infinity Process Platform Portal in the End User Handbook End User Handbook for details.

Note: The Quality Assurance Codes are not supported yet.