obpm papi technical session
TRANSCRIPT
<Insert Picture Here>
Ariel Morelli AndresAriel CohenSoftware Developers – [email protected]@oracle.com
PAPI Technical Session
Agenda
• General Concepts• Architecture
• Different connections
• Internal Components
• PAPI Cache
• News Types
• API Review• Workshop
• Building a PAPI Client
• Debugging News
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
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
PAPI Architecture
WebLogic Server
Engine
Local/t3
Directory
Directory DB
LDAP
JDBC/JNDI JDBC/ JNDI
Engine DB
JDBC
Local/t3
Local/t3
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
PAPI Architecture
ProcessService
Instance Cache
Organization Manager
GroupsCache
RolesCache
ParticipantCache
SessionManager
EngineAccessCache
LocalCatalogManager
Presentation Manager
PresentationCache
VariableManager
ViewManager(Cache)
PAPI Architecture
ProcessServiceSession
SessionPresentation
Manager
SessionView
Manager
ProcessService
PresentationManager
ViewManager
EngineAccess
SecureEngine
Map
ProcessControl
Map
CurrentParticipant
SessionID
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
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
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
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
PAPI Architecture
Engine
Tim
e
activityExecute(...)
result
15s
Server News (instance_updated: result)
Internal News (instance_updated: result)
PAPIPAPIPAPI
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
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)
Agenda
• General Concepts• Architecture
• Different connections
• Internal Components
• PAPI Cache
• News Types
• API Review• Workshop
• Building a PAPI Client
• Debugging News
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(...)
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
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
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
Workshop
• Windows• \\fuegomovil2\workshop\papi
• Linux• smb://fuegomovil2/workshop/papi
Q&A