2. Affordable Workflow Options for Your APEX App 2
Facts & Figures
Independent Technology House
with Cross-Industry Expertise
Headquarter
Ratingen
(North Rhine – Westphalia)
240
employed
Founded
1994
Branches
Dortmund, Cologne,
Frankfurt am Main
Top Company
for Trainees &
Students
Privately-
Owned
Corporation
Oracle
Platinum
Partner
28 Mio. Euro
Revenue
3. Affordable Workflow Options for Your APEX App 3
About me
§ Niels de Bruijn, Business Unit Manager APEX
§ Born in 1977, married, three daughters, living in Ratingen
§ Working for MT AG since DEC-2003
§ After working for 2 years as Oracle consultant for Oracle Nederland B.V.
§ Track record with APEX since its inception
§ Responsible for all APEX activity in the company
§ Knowledge Portal: apex.mt-ag.com
§ Presenting at Kscope, DOAG Conference, APEX Connect and Open World amongst others
§ ODTUG - Part of APEX Content Committee for Kscope
§ DOAG – Initiator & Conference Chair of APEX Connect
4. Affordable Workflow Options for Your APEX App
§ About workflow in APEX
§ Affordable workflow options for your APEX app
§ Spotlight: APEX & Camunda Community Edition
§ How it works
§ Live Demo
§ Modelling your workflow with bpmn.io
§ What did we learn?
Agenda
5. Affordable Workflow Options for Your APEX App
§ Which workflow?! There simply is no workflow feature in APEX (up to 5.1).
§ Also nothing planned for APEX 5.2
§ First thought: Hardcoding your workflow with PL/SQL (DON‘T DO THIS!)
§ Option 1: Define your workflow definition in tables
§ PL/Flow
§ Flow Control
§ Option 2: Integrate Camunda
5
Affordable workflow options for your APEX app
6. Affordable Workflow Options for Your APEX App
§ PL/Flow from Yeb Havinga (http://plflow.sourceforge.net)
+ Easy to install, 100% PL/SQL incl. PL/SQL API
+ Open Source
- No graphical interface to maintain the workflow
- Not standardized (no BPMN support)
- No updates since its last release in 2004
§ Flow Control from Jürgen Sieben (https://github.com/j-sieben/FCT)
+ Easy to install, 100% PL/SQL incl. PL/SQL API
+ Open Source
+ Released in JUN-2016, actively maintained by Jürgen Sieben
- No graphical interface to maintain the workflow
- Not standardized (no BPMN support)
6
Option 1: Workflow definition in tables
8. Affordable Workflow Options for Your APEX App
What if your requirements go one step further?
§ BPMN 2.0 support
§ Graphical Interface (both design-time as well as run-time) to document the process incl. manual steps
§ Tool to monitor processes
§ Support-Option available
8
Option 2: Workflow definition in BPMN (WYSIWYG)
9. Affordable Workflow Options for Your APEX App
§ Camunda as run-time Engine (camunda.org)
§ Fork of activiti
§ Regularly updated
§ Large team working on it (HQ based in Berlin)
§ Open Source
§ Supports various standards like BPMN 2.0, CMMN 1.1 and DMN 1.1
§ Available in two editions: free Community Edition & Enterprise Edition
9
Option 2: Camunda Community Edition
Source: camunda.com (3-MAR-2017)
10. Affordable Workflow Options for Your APEX App
§ Some usefull (Java) Apps can be installed to monitor processes, administrate users, etc.
10
Option 2: Camunda Community Edition
12. Affordable Workflow Options for Your APEX App 12
APEX and Camunda: how it works
Optional:
Camunda Apps
(ie. Cockpit)
ORDS
REST-API
APEX
Workspace Schema
APEX
Metadata Repository
Camunda
Metadata Repository
Oracle DatabaseBrowser
read-out
process status
initiate
process
Apache Tomcat
bpmn-viewer.js
13. Affordable Workflow Options for Your APEX App
§ REST Web Service call
§ All logic stays in APEX: we tell Camunda what to do in which case
13
APEX and Camunda: instantiating a process with APEX
my_process
14. Affordable Workflow Options for Your APEX App
1. Read out the BPMN definition (XML file) from the metadata repository
select gby.bytes_
from act_ge_bytearray gby
, act_re_procdef rpf
where gby.deployment_id_ = rpf.deployment_id_
and rpf.key_ = 'recruitment-procedures'
order by rpf.version_ desc
fetch first 1 rows only
2. Use bpmn-viewer.js to render the process (SVG)
14
APEX and Camunda: show process status
15. Affordable Workflow Options for Your APEX App
3. Use custom JavaScript to highlight current state:
//Highlight current status
function markUp(temp){
var parent = document.getElementById(temp);
parent.childNodes[0].childNodes[0].setAttribute("style", "stroke: #056693; stroke-
width: 4; fill: #b5e6fd");
}
var dlCheck = $('#P2_DL').val(); //P2_DL contains the PK of the APEX table
if (dlCheck != ''){
var element = $('#P2_ST').val() //P2_ST contains the CSS ID of the element
markUp(element);
};
15
APEX and Camunda: show process status
16. Affordable Workflow Options for Your APEX App
§ APEX user is passed to Camunda for auditing purposes
select hi.proc_def_key_ as Process_Definition
, hi.proc_inst_id_ as Process_Key
, hi.assignee_ as Approved_By
, hi.act_name_ as Task
, hi.start_time_ as Start_Time
, hi.end_time_ as End_Time
, apx.candidate as Candidate
from act_hi_actinst hi
, act_ru_variable ru
, act_apx_cam_variable apx
where hi.proc_inst_id_ = ru.proc_inst_id_
and apx.id = ru.text_
and hi.act_type_ = 'userTask'
and ru.name_ = 'id'
order by hi.start_time_ desc
;
16
APEX and Camunda: show history
17. Affordable Workflow Options for Your APEX App 17
About BPMN 2.0
See all on
https://camunda.org/bpmn/reference/
18. Affordable Workflow Options for Your APEX App
§ https://bpmn.io
§ Open Source Tool to model your workflows
§ Works locally in your browser or can be part of your app
§ Your work is saved in BPMN 2.0 (XML)
18
Modelling your workflow with bpmn.io
20. Affordable Workflow Options for Your APEX App
§ Web Service call
20
Deploying a new process using a REST client in Chrome
21. Affordable Workflow Options for Your APEX App
§ There is no workflow feature in APEX 5.x and nothing such is planned for the near future
§ Use Workflow Control if
§ you don‘t need BPMN 2.0 support
§ you don‘t need to visualize or graphically design the workflow
§ Otherwise go for Camunda Community Edition
§ It integrates seemlessly with APEX and doesn‘t cost you anything (other than time)
§ Supports all standards (so you can migrate to another product if needed)
§ Enables you to visualize and graphically design your workflow process
21
What did we learn?