OBPM Papi Technical Session

22
<Insert Picture Here> Ariel Morelli Andres Ariel Cohen Software Developers – CCE [email protected] om [email protected] PAPI Technical Session

Transcript of OBPM Papi Technical Session

Page 1: OBPM Papi Technical Session

<Insert Picture Here>

Ariel Morelli AndresAriel CohenSoftware Developers – [email protected]@oracle.com

PAPI Technical Session

Page 2: OBPM Papi Technical Session

Agenda

• General Concepts• Architecture

• Different connections

• Internal Components

• PAPI Cache

• News Types

• API Review• Workshop

• Building a PAPI Client

• Debugging News

Page 3: OBPM Papi Technical Session

General Concepts

• What is PAPI?• PAPI is a Java client-server API that allows you to interact

with processes deployed on an ALBPM Process Execution Engine.

• Which applications are built on top of it?• Workspace

• PAPI-WS

• Feeds

• Custom applications

Page 4: OBPM Papi Technical Session

PAPI Architecture

• Provides a Service as the entry point for operations

• Multiple PAPI Services running against one Engine

• Communication• Outbound to Engines: RMI, RMI/IIOP

• Outbound to Directory Service: JDBC, JNDI

Page 5: OBPM Papi Technical Session

PAPI Architecture

WebLogic Server

Engine

Local/t3

Directory

Directory DB

LDAP

JDBC/JNDI JDBC/ JNDI

Engine DB

JDBC

Local/t3

Local/t3

Page 6: OBPM Papi Technical Session

PAPI Architecture

Directory

PAPI

•Performs authentication.•Retrieves participants, roles and groups.•Retrieves views and presentations.

Engine

•Performs operations.•Retrieves processes and process instances

•Retrieves processes and configuration information.

•Retrieves participants, roles and groups

EngineEngine

News

PoolingNews (J2EE)

RMI/EJB

JDBC/JNDI

Page 7: OBPM Papi Technical Session

PAPI Architecture

ProcessService

Instance Cache

Organization Manager

GroupsCache

RolesCache

ParticipantCache

SessionManager

EngineAccessCache

LocalCatalogManager

Presentation Manager

PresentationCache

VariableManager

ViewManager(Cache)

Page 8: OBPM Papi Technical Session

PAPI Architecture

ProcessServiceSession

SessionPresentation

Manager

SessionView

Manager

ProcessService

PresentationManager

ViewManager

EngineAccess

SecureEngine

Map

ProcessControl

Map

CurrentParticipant

SessionID

Page 9: OBPM Papi Technical Session

PAPI Architecture

Instance Cache

/Pro

cess

Nam

e#D

efau

lt-1.

0 InstanceCacheEntry

maxsize

maxincrementpercent

warningsevere

thresholds

instances

Map<key, InstanceInfo>

key = instanceIN ++ threadIN

status

UNKNOWNFILLINGCLOSED

OPEN

Page 10: OBPM Papi Technical Session

PAPI Architecture

• The cache entry starts with an UNKNOWN status

Standalone PAPI Cache Status

UNKNOWN FILLING

• When the first cache entry operation occurs, the status is changed to FILLING and the filling process is started in a asynchronous way

CLOSEDOPEN

• When the cache entry filling process is completed, the status is changed to CLOSED

• If at any moment there are more instances than the maximum specified plus the increment then the status is changed to OPEN and the cache is disabled for that process

Page 11: OBPM Papi Technical Session

PAPI Architecture

• The cache entry starts with an UNKNOWN status

J2EE PAPI Cache Status

UNKNOWN

• When the first cache entry operation occurs the filling process is started in a synchronous way

CLOSEDOPEN

• When the cache filling process is completed, the status is changed to CLOSED

• If at any moment there are more instances than the maximum specified plus the increment then the status is changed to OPEN and the cache is disabled for that process

Page 12: OBPM Papi Technical Session

PAPI Architecture

• PAPI Cache characteristics• Each CLOSED entry contains ALL the running instances (as

it's a whole copy of the instances it's wrongly named “cache”)

• The engine sends updates to PAPI Cache via news

• In Standalone versions, news can be delayed in order to take advantage of piggy-back mechanism

Page 13: OBPM Papi Technical Session

PAPI Architecture

Engine

Tim

e

activityExecute(...)

result

15s

Server News (instance_updated: result)

Internal News (instance_updated: result)

PAPIPAPIPAPI

Page 14: OBPM Papi Technical Session

PAPI Architecture

• Instance News• INSTANCE_CREATED = 0

• INSTANCE_TERMINATED = 1

• INSTANCE_UPDATED = 2

• Process Deployment News• DEPLOY_PROCESS = 4

• REPLACE_PROCESS_DEFINITION = 5

• DEPRECATE_PROCESS = 6

• ACTIVATE_PROCESS = 7

• UNDEPLOY_PROCESS = 8

• STOP_PROCESS = 14

Page 15: OBPM Papi Technical Session

PAPI Architecture

• Others• SHUTDOWN = 3

• NO_MORE_NEWS = 9 (Standalone)

• PARTICIPANT_DISCONNECTED = 10

• FILL_CACHE = 11 (Standalone)

• UPDATE_FDI = 12 (J2EE)

• END_REACHED = 13

• REFRESH = 15 (J2EE)

Page 16: OBPM Papi Technical Session

Agenda

• General Concepts• Architecture

• Different connections

• Internal Components

• PAPI Cache

• News Types

• API Review• Workshop

• Building a PAPI Client

• Debugging News

Page 17: OBPM Papi Technical Session

API Review

• ProcessService• create(java.util.Properties) (static)

• ProcessService.DIRECTORY_ID

• ProcessService.DIRECTORY_PROPERTIES_FILE or ProcessService.DIRECTORY_PROPERTIES_RESOURCE or ProcessService.DIRECTORY_PROPERTIES_URL

• ProcessService.INSTANCES_CACHE_SIZE

• ProcessService.WORKING_FOLDER

• Logs – Since 10.3. Not documented yet

• startUpdater(long milliseconds)

• createSession(...)

Page 18: OBPM Papi Technical Session

API Review

• ProcessServiceSession capabilities• Create, send and abort process instances

• Select and unselect process instances

• Reassign process instances

• Audit an instance

• Suspend and resume process instances

• Grab and un-grab process instances

• Run intactive and global interactive activities

• Run external tasks

• Send notifications

Page 19: OBPM Papi Technical Session

API Review

• ProcessServiceSession capabilities• Get a list of process instances

• Get a list of deployed processes

• List the activities in a deployed process

• Get the latest version of a deployed process

• Manage views and presentations

• Manage attachments

• More info athttp://edocs.bea.com/albsi/docs60/papi_javadocs/index.html

Page 20: OBPM Papi Technical Session

API Review

• System properties• J2EE InitialContex properties

• fuego.j2ee.initialctx.[engineID].file• fuego.j2ee.initialctx.[engineID].resource• fuego.j2ee.initialctx.[engineID].url• fuego.j2ee.initialctx.file• fuego.j2ee.initialctx.resource• fuego.j2ee.initialctx.url

• News debugging • DRAFT: fuego.papi.news.debug=true

Page 21: OBPM Papi Technical Session

Workshop

• Windows• \\fuegomovil2\workshop\papi

• Linux• smb://fuegomovil2/workshop/papi

Page 22: OBPM Papi Technical Session

Q&A