affordable workflow options for apex

22
Affordable Workflow Options for your APEX App Niels de Bruijn March 30th, 2017

Upload: niels-de-bruijn

Post on 16-Apr-2017

965 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Affordable Workflow Options for APEX

Affordable Workflow Optionsfor your APEX App

Niels de Bruijn

March 30th, 2017

Page 2: Affordable Workflow Options for APEX

Affordable Workflow Options for Your APEX App 2

Facts & Figures

Independent Technology Housewith Cross-Industry Expertise

HeadquarterRatingen

(North Rhine – Westphalia)

240 employed

Founded1994

BranchesDortmund, Cologne,Frankfurt am Main

Top Company for Trainees &

Students

Privately-Owned

Corporation

Oracle Platinum Partner

28 Mio. Euro Revenue

Page 3: Affordable Workflow Options for APEX

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

Page 4: Affordable Workflow Options for APEX

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

Page 5: Affordable Workflow Options for APEX

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

Page 6: Affordable Workflow Options for APEX

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

Page 7: Affordable Workflow Options for APEX

Affordable Workflow Options for Your APEX App 7

APEX & Flow Control: Live Demo

Page 8: Affordable Workflow Options for APEX

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)

Page 9: Affordable Workflow Options for APEX

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)

Page 10: Affordable Workflow Options for APEX

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

Page 11: Affordable Workflow Options for APEX

Affordable Workflow Options for Your APEX App 11

APEX & Camunda: Live Demo Run-Time

Page 12: Affordable Workflow Options for APEX

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

APEXMetadata Repository

CamundaMetadata Repository

Oracle DatabaseBrowser

read-outprocess status

initiateprocess

Apache Tomcat

bpmn-viewer.js

Page 13: Affordable Workflow Options for APEX

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

Page 14: Affordable Workflow Options for APEX

Affordable Workflow Options for Your APEX App

1. Read out the BPMN definition (XML file) from the metadata repositoryselect 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_ descfetch first 1 rows only

2. Use bpmn-viewer.js to render the process (SVG)

14

APEX and Camunda: show process status

Page 15: Affordable Workflow Options for APEX

Affordable Workflow Options for Your APEX App

3. Use custom JavaScript to highlight current state://Highlight current statusfunction 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 tableif (dlCheck != ''){

var element = $('#P2_ST').val() //P2_ST contains the CSS ID of the elementmarkUp(element);

};

15

APEX and Camunda: show process status

Page 16: Affordable Workflow Options for APEX

Affordable Workflow Options for Your APEX App

§ APEX user is passed to Camunda for auditing purposesselect 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 Candidatefrom act_hi_actinst hi, act_ru_variable ru, act_apx_cam_variable apxwhere 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

Page 17: Affordable Workflow Options for APEX

Affordable Workflow Options for Your APEX App 17

About BPMN 2.0

See all on https://camunda.org/bpmn/reference/

Page 18: Affordable Workflow Options for APEX

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

Page 19: Affordable Workflow Options for APEX

Affordable Workflow Options for Your APEX App 19

bpmn.io: Live Demo

Page 20: Affordable Workflow Options for APEX

Affordable Workflow Options for Your APEX App

§ Web Service call

20

Deploying a new process using a REST client in Chrome

Page 21: Affordable Workflow Options for APEX

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?

Page 22: Affordable Workflow Options for APEX

@nielsdb

http://de.linkedin.com/in/nielsdebruijn

https://blog.mt-ag.com/apex