Oracle® Beehive Application Developer's Guide Release 1 (1.4) Part Number E13800-01 |
|
|
View PDF |
Oracle Beehive's integration with Oracle BPEL Process Manager allows you to create your own BPEL workflow processes and deploy them in your environment. A BPEL process can leverage Oracle Beehive task integration, and it can be invoked either from Oracle Beehive or from external sources.
Refer to "Oracle Beehive Custom Workflow" found in the Oracle Beehive Web site on Oracle Technology Network for a tutorial that demonstrates how to define a BPEL process that is invoked from Oracle Beehive and leverages BPEL task integration.
In this tutorial, you define an Oracle Beehive policy that will determine when the BPEL process will be invoked. This policy definition also determines which XML data is sent to the workflow process, which is defined with JXPaths. The following section describes how to construct JXPaths.
Each JXPath has the following structure:
<method>#<method>#...@<XML element name>
For example, the following is the first JXPath in this policy, which retrieves the identifier of the newly added document, then maps this value to the <entityId>
element in the generated XML:
getCommonAttributes#getEntityId#toCollabId@entityId
To get the list of available attributes for a particular event, use the command beectl list_events --name
<event name>
. For <event name>
, use the value in the <eventTypeName>
element in the policy.
For example, this policy invokes the HelloWorldWFAction
when a document is created. The event name for this is DOCUMENT_CREATED
. The following is a description of this event and its attributes:
beectl list_events --name DOCUMENT_CREATED
Event Name: DOCUMENT_CREATED
Event Description: Raised when a new document is created in a heterogeneous folder. This event is also raised when an existing document is copied to a new heterogeneous folder.
Is Synchronous: N
------------------------------------
Event Subscriptions:
------------------------------------
Name: HelloWorldDocCreated
Event Subscription Id: 26C9:2946:evts:37275AA4FF80934DE040578C201A154B0000000493F5
Event Action Function: oracle.ocs.management.model.WorkflowService:HelloWorld
Is PLSQL Action: N
------------------------------------
Event Attributes:
------------------------------------
Name: COMMON_ATTRIBUTES Type: OCS_CODE.ECA_COMMON_EVENT_ATTRIBS_T
Name: ENTITY_ID Type: OCS_CODE.OCS_COLLAB_ID_T
Name: CONTAINER Type: OCS_CODE.OCS_COLLAB_ID_T
Name: ACTOR_ID Type: OCS_CODE.OCS_COLLAB_ID_T
Name: OPERATION Type: STRING
Name: STATUS Type: STRING
Name: MESSAGE Type: STRING
Name: EVENT_NAME Type: STRING
Name: LOGON_RECORD_ID Type: INTEGER
Name: EVENT_ID Type: INTEGER
Name: CUSTOM_ATTRIBUTES Type: OCS_CODE.WS_DOCUMENT_EVENT_ATTRIBS_T
Name: ARTIFACT_ATTRIBUTES Type: OCS_CODE.AM_COMMON_EVENT_ATTRIBS_T
Name: SIZE_CHANGE Type: INTEGER
Name: NEW_CONTAINER Type: OCS_CODE.OCS_COLLAB_ID_T
To retrieve the value of an attribute, perform the following steps to the attribute's name:
Convert the attribute name to lower case
Capitalize the first letter of the attribute name. and the letter after each underscore
Remove all underscores
Append get
to the beginning of the name
Attributes are stored in a tree structure. For example, to retrieve the value of ENTITY_ID, you will have to retrieve COMMON_ATTRIBUTES first.
You may use the following methods in your JXPath:
toCollabID
: Retrieves the identifier of the specified entity
ASENTITY
: Converts the identifier back into an entity so that you can retrieve other attributes and entities from it, such as its name with getName
.
iterator
: Use this with next
to retrieve all entities in a list.