You are not looking at the latest version of the documentation. Check it out there.

Flows for APEX enables every APEX developer to create and run process flows for their APEX apps. Have a look yourself what Flows for APEX can do for you!

Example Process running

Installation

Download the latest version of the packaged app here and import it into your APEX workspace. You can find more information about the installation process here

First steps with the engine app

Create your first model

  • Log into the Flows for APEX application, open the menu and go to “Flow Management”.
  • Click on the “Create Model” button.
  • Complete the form with the following information
    • Category: “Tutorial”
    • Name: “Getting Started”
    • Version: “0”

Create First Model

  • Click on the “Create” button

    Edit your first BPMN diagram

  • Click on the “Modify Diagram” button in the Flow Viewer region header to open the Flow Modeler
  • On the toolbar, click on the Start Event, drag it in the blank area then double click on the event and type “Start” in the textarea.

Add Start Event

  • Select the start event, click on “Append Task” and type “First Task” Add Task
  • Select the Task, click on “Append EndEvent”, then double click on the End Event and type “End” Add End Event
  • Click on Apply Changes to save the diagram.

Create your first process instance

  • Open the menu and go to Flow Monitor
  • Click on “Create instance”
  • Fill the form as it
    • Model: “Getting Started”
    • “Name”: “First Instance”

Fill the instance form

  • Click on “Create”

Start your first process instance

  • On the Flow Instances report, click on the row menu action of your instance and select start

Start Your First Instance

  • You can now see that the process instance is started

Your First Instance is Started

  • Go to the instance details page by using the row menu action or by clicking on the quick action “Details”.

    Complete your first task

  • On the Subflows report, you can see the current running subflows. You can complete the step by using either the row action menu or the quick action link.

Complete The Task

  • After completing the step, the process instance is now completed.

Process Instance Completed

Integration into an APEX application

Create a new APEX application

Create a new APEX application and call it Getting Started

Import the plug-ins

  • Go to Shared Components –> Plug-ins and click on Create
  • Choose the option “As a Copy of an Existing Plug-in” and click on Next
  • Select the Flows for APEX applicaiton and click Next
  • Import all the plug-ins except “Flows for APEX - Modeler” by clicking on Copy Plug-ins

Use the Manage Flow Instance plug-in

  • On page 1, create a new region:
    • Identification:
      • Title: My Tasks
      • Type: Static Content (default)
    • Layout:
      • Position: Content Body
  • Add a new button on the same page:
    • Identification
      • Button Name: CREATE_INSTANCE
      • Label: Create Instance
    • Layout:
      • Region: My Tasks
      • Button Position: Edit

Getting Started Integration Step 1

  • Add a new process on the same page:
    • Identification:
      • Name: Create and Start Instance
      • Type: Flows for APEX - Manage Flow Instance [Plug-in]
    • Settings:
      • Action: Create and Start (default)
      • Flow Instance Name: Getting Started - &APP_USER.
      • Select Flow Using: Static Text (default)
      • Flow (Diagram) selection based on: Name (default)
      • Set Business Reference: none (default)
      • Return Instance ID into: none (default)
      • Set Process Variables?: No Process Variables (default)
    • Server-side Condition:
      • When Button Pressed: CREATE_INSTANCE

Getting Started Integration Step 2

Now, run your application and click on the Create Instance button. Nothing happens? Are you sure? Go on the engine app and open the Flow Monitor page. As you see, we just create a new instance and if you click on the Name you will see that it is also running.

Getting Started Integration Step 3

That’s cool but you didn’t see anything on your custom application so lets see if we can fix that.

Display the tasks

Flows for APEX comes with several views to help you to integrate it into your application, one of them is the flow_task_inbox_vw view.

  • Update the region “My Tasks”:
    • Identification:
      • Type: Classic Report
    • Source
      • Location: Local Database
      • Type: SQL Query
      • SQL Query
         select sbfl_id,
               sbfl_prcs_id,
               sbfl_process_name,
               sbfl_prcs_init_ts,
               sbfl_current_name,
               sbfl_status
         from flow_task_inbox_vw
         where sbfl_dgrm_name = 'Getting Started'
        

Save and run the page and you should now see the list of tasks that need to be completed!

Getting Started Integration Step 4

Display the workflow viewer

One major advantage of Flows for APEX is the ability to see the workflow state graphically and we provide a plug-in and a view to make it easier.

  • Create a new plug-in page Getting Started Integration Step 5
  • Select “Flows for APEX - Viewer” and click on Next Getting Started Integration Step 6
  • Set the Page Name to “Workflow Viewer”, make sure the selected Page Mode is “Modal Dialog” and click on Next Getting Started Integration Step 7
  • Choose the “Do not associate this page with a navigation menu entry” and click on Next
  • Select the view flow_instance_details_vw and click on Next Getting Started Integration Step 8
  • Change the attributes Add Highlighting to Yes (see screenshot) and click on Create Getting Started Integration Step 9
  • Add an APEX item on the Viewer region:
    • Identification:
      • Name: P2_PRCS_ID
      • Type: Hidden

Getting Started Integration Step 10

  • Select the region Workflow Viewer and under Source/Where Clause add: prcs_id = :P2_PRCS_ID

Getting Started Integration Step 11

  • Edit the page 1, on the “My Tasks” Region make the following changes:
    • Column SBFL_ID
      • Identification:
        • Type: Hidden Column
    • Column SBFL_PRCS_ID
      • Identification:
        • Type: Link
      • Heading:
        • Heading: “-“
      • Link:
        • Target: Getting Started Integration Step 12
        • Link Text: <span class="fa fa-search" aria-hidden="true"></span>
    • Column SBFL_PROCESS_NAME
      • Heading:
        • Heading: Instance Name
    • Column SBFL_PRCS_INIT_TS
      • Heading:
        • Heading: Init Date
    • Column SBFL_CURRENT_NAME
      • Heading:
        • Heading: Current Task
    • Column SBFL_STATUS
      • Heading:
        • Heading: Status

Save and Run the page, you should now be able to click on the link and see your instance state in the Viewer!

Getting Started Integration Step 13

Now it’s time to complete that task from your custom application.

Use the Manage Flow Instance Step plug-in

  • Create a new blank modal page called “Task” without entry in the menu. Page ID should be 3.
  • On the new page, create a new region “Task” in the Centent Body and add two items:
    • P1_PRCS_ID type Hidden
    • P1_SBFL_ID type Hidden
  • Add a new button COMPLETE
  • Add a first process
    • Settings
      • Name: Complete Task
      • Type: Flows for APEX - Manage Flows Instance Step [Plug-in]
      • Action: Complete Step
      • Flow Instance info: In Page Items (default)
      • Process ID item: P3_PRCS_ID
      • Subflow ID item: P3_SBFL_ID
      • Set Gateway Routing?: false (default)
      • Auto-Branching?: false (default)
      • Return Flow Instance and Subflow ID?: none (default)
    • Server Side Condition:
      • When Button Pressed: COMPLETE
  • Add a second process
    • Settings
      • Name: Close Dialog
      • Type: Close Dialog
    • Server Side Condition:
      • When Button Pressed: COMPLETE
  • Edit page 1 and, on region “My Tasks”, update column SBFL_ID:
    • Identification:
      • Type: Link
    • Link
      • Target: Getting Started Integration Step 13
      • Link Text: <span class="fa fa-edit" aria-hidden="true"></span>
  • Add a new Dynamic Action:
    • Identification:
      • Name: Edit Step Close
    • When
      • Event: Dialog Closed
      • Selection Type: Region
      • Region: My Tasks
    • Advanced:
      • Event Scope: Dynamic
  • Action when True:
    • Identification:
      • Action: Refresh
    • Affected Elements:
      • Selection Type: Region
      • Region: My Tasks

Save and Run page 1, you should now see a new link, click on it, a new modal page should open and have a complete button. Click on that button and your task will be completed. You can check on the engine app that your instance is correctly completed.

Getting Started Integration Step 14

Going further

Congratulations, you have just complete our getting started tutorial and learn the basics of the following concepts:

  • Create a new model
  • Edit a BPMN diagram in the online editor
  • Create and start a process instance
  • Complete a step in the instance detail page
  • Integrate Flows for APEX in a custom application with the plug-ins

To go further, we recommend you to follow our BPMN tutorials or download our step by step APEX integration tutorial.