Using Declarative Components and Task Flows 25-49
} public String getDateFormat {
return DATE_STYLE; }
public String getTimeFormat { return TIME_STYLE;
} }
9.
Create a Managed Bean called MyBean.java to return the implementation of MetadataDetails and NLSPreferences. It also returns the
oracle.integration.console.metadata.model.share.MetadataDetai lsMode object and provides event handlers such as toggleMode,
saveDictionary, saveNoValidateDictionary, and validate.
The following is a sample of the MyBean.java file: package useruledicttaskflow;
import javax.el.ELContext; import javax.el.ExpressionFactory;
import javax.el.MethodExpression;
import javax.faces.context.FacesContext; import javax.faces.event.PhaseId;
import oracle.adf.view.rich.component.rich.fragment.RichRegion; import oracle.integration.console.metadata.model.share.MetadataDetails;
import oracle.integration.console.metadata.model.share.MetadataDetailsMode; import oracle.integration.console.metadata.model.share.NLSPreferences;
public class MyBean { private MyMetaDataDetails details = null;
private MetadataDetailsMode mode = MetadataDetailsMode.VIEW; private RichRegion regionComp;
private NLSPreferences nlsPrefs;
public MyBean { super;
}
public MetadataDetails getMetaDataDetails { if details = null
return details;
details = new MyMetaDataDetails; return details;
}
public MetadataDetailsMode getDetailsMode { return mode;
}
public void toggleMode { if mode.equalsMetadataDetailsMode.EDIT
mode = MetadataDetailsMode.VIEW; else
mode = MetadataDetailsMode.EDIT;
25-50 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite
} public void saveDictionary {
if regionComp == null return;
FacesContext fc = FacesContext.getCurrentInstance; ExpressionFactory ef = fc.getApplication.getExpressionFactory;
ELContext elc = fc.getELContext; MethodExpression me =
ef.createMethodExpressionelc, doMetadataUpdate, String.class, new Class[] { };
regionComp.queueActionEventInRegionme, null, null, false, -1, -1, PhaseId.ANY_PHASE;
}
public void saveNoValidateDictionary { if regionComp == null
return; FacesContext fc = FacesContext.getCurrentInstance;
ExpressionFactory ef = fc.getApplication.getExpressionFactory; ELContext elc = fc.getELContext;
MethodExpression me = ef.createMethodExpressionelc, doNoValidateMetadataUpdate,
String.class, new Class[] { }; regionComp.queueActionEventInRegionme, null, null, false, -1, -1,
PhaseId.ANY_PHASE; }
public void validate { if regionComp == null
return; FacesContext fc = FacesContext.getCurrentInstance;
ExpressionFactory ef = fc.getApplication.getExpressionFactory; ELContext elc = fc.getELContext;
MethodExpression me = ef.createMethodExpressionelc, doValidate, String.class,
new Class[] { }; regionComp.queueActionEventInRegionme, null, null, false, -1, -1,
PhaseId.ANY_PHASE; }
public void setRegionCompRichRegion regionComp { this.regionComp = regionComp;
} public RichRegion getRegionComp {
return regionComp; }
public NLSPreferences getNlsPrefs { if nlsPrefs = null
return nlsPrefs;
nlsPrefs = new MyNLSPreferences; return nlsPrefs;
} }
10. Open the faces-config.xml file in the Overview mode and click the + button
under Managed Beans to display the Create Managed Bean dialog box. Point to
Using Declarative Components and Task Flows 25-51
MyBean.java by providing the Bean Name as MyBean and the Scope as session as shown in
Figure 25–53 .
Figure 25–53 Specifying the Bean Name and Scope in the Task Flow Application
To add a Rules Dictionary Editor task flow in a .jspx file: The next task is to create the .jspx file to include the Rules Dictionary Editor
component tag.
The steps are:
1. Open Oracle JDeveloper.
2. From the File menu, select New to display the New Gallery dialog box.
3. In the New Gallery dialog box, select JSF under Web Tier from the Categories
panel.
4. Select JSF Page under Items and click OK to display the Create JSF Page dialog
box as shown in Figure 25–54
.
25-52 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite
Figure 25–54 Creating the JSF Page File to Include the Rules Dictionary Editor Task
Flow
5. In the Create JSF Page dialog box, enter useRuleDictTaskFlow.jspx as the
file name as shown in Figure 25–55
.
Figure 25–55 Specifying the Name of the JSF Page for the Task Flow
adflibRuleDictionaryTaskFlow.jar is displayed in the component palette of Oracle JDeveloper as shown in
Figure 25–56 .
Using Declarative Components and Task Flows 25-53
Figure 25–56 Rules Dictionary Task Flow JAR in the Component Palette
This is because you have added the Oracle Rules Dictionary Task Flow shared library when creating the sample application.
6.
Select adflibRuleDictionaryTaskFlow.jar to make rule-dict-flow-definition to be available under Regions in the component
palette. You can drag and drop the rule-dict-flow-definition region into the .jspx file as shown in
Figure 25–57 , and specify all the required parameters.
Figure 25–57 Dragging and Dropping the Region
The following is a sample of the useRuleDictTaskFlow.jspx file with the task flow added:
f:view af:document id=d1
af:form id=f1 af:panelStretchLayout id=psl1 inlineStyle=margin:8px;
f:facet name=top
25-54 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite
af:menuBar id=mb1 af:commandMenuItem text=Toggle Mode id=cmi1
action={MyBean.toggleMode} partialSubmit=true
af:commandMenuItem text=Save Dict id=cmi2 action={MyBean.saveDictionary}
partialSubmit=true af:commandMenuItem text=Save Dict No Validate id=cmi3
action={MyBean.saveNoValidateDictionary} partialSubmit=true
af:commandMenuItem text=Validate id=cmi4 action={MyBean.validate}
partialSubmit=true af:menuBar
f:facet f:facet name=center
af:region value={bindings.rulesdictflowdefinition1.regionModel} id=r2 binding={MyBean.regionComp}
partialTriggers=::cmi1 ::cmi2 ::cmi3 ::cmi4 f:facet
af:panelStretchLayout af:form
af:document f:view
In the preceding sample, you can find code snippets for rendering the following buttons to the page:
■
Toggle Mode : Enables switching between Read-Only and Editable modes of
SOA Composer
■
Save Dict : Enables saving the dictionary with or without validation
To edit the pagedef.xml file: After you add the task flow to the .jspx file, you must edit the
useRuleDictTaskFlowPageDef.xml file. The pagedef.xml file is created when you drop the Rules Dictionary task flow into the .jspx page.
The following is a sample of the pagedef.xml file along with all the parameters that must be passed to the Rules Dictionary task flow:
?xml version=1.0 encoding=UTF-8 ? pageDefinition xmlns=http:xmlns.oracle.comadfmuimodel
version=11.1.1.55.99 id=useRuleDictTaskFlowPageDef Package=useruledicttaskflow.pageDefs
parameters executables
variableIterator id=variables taskFlow id=rulesdictflowdefinition1
taskFlowId= WEB-INFrule-dict-flow-definition.xmlrules-dict-flow-definition activation=deferred
xmlns=http:xmlns.oracle.comadfcontrollerbinding parameters
parameter id=details value={MyBean.metaDataDetails} xmlns=http:xmlns.oracle.comadfmuimodel
parameter id=mode value={MyBean.detailsMode} xmlns=http:xmlns.oracle.comadfmuimodel
parameter id=dtHeight value=10 xmlns=http:xmlns.oracle.comadfmuimodel
parameter id=selectedTab value=Ruleset_1 xmlns=http:xmlns.oracle.comadfmuimodel
Using Declarative Components and Task Flows 25-55
parameter id=dtColumnPageSize value=6 xmlns=http:xmlns.oracle.comadfmuimodel
parameter id=nlsPrefs value={MyBean.nlsPrefs} xmlns=http:xmlns.oracle.comadfmuimodel
parameter id=discloseRules value=true xmlns=http:xmlns.oracle.comadfmuimodel
parameters taskFlow
executables bindings
pageDefinition
To refer to the oracle.rules and the oracle.soa.rules_dict_dc.webapp shared libraries:
The next task is to refer to the oracle.rules and oracle.soa.rules_dict_ dc.webapp shared libraries from the weblogic-application.xml file.
For more information on referring to the shared libraries, see Section 25.3.2, How to
Create and Run a Sample Application by Using the Rules Dictionary Editor Component.
To run the sample task flow application: The last task is running the sample application in the embedded server.
To run the sample application, from Oracle JDeveloper, right-click the useRulesDictTaskFlow.jspx file, and select Run. This starts the sample application on a
Web browser as shown in Figure 25–46
.
Figure 25–58 Running the Sample Rules Dictionary Editor Task Flow Application
25.4.3 How to Deploy a Rules Dictionary Editor Task Flow Application to a Standalone Weblogic Server
When you are ready to deploy your application EAR file to the standalone Weblogic server, perform the following:
1. Launch the Weblogic server console
http:host:portconsoleloginLoginForm.jsp and ensure that oracle.rules is displayed in the deployments list.
25-56 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite
2.
Ensure that oracle.soa.rules_dict_dc.webapp is displayed in the deployments list. If this is not displayed, click Install and select the JDEV_
INSTALLjdevelopersoamodulesoracle.soa.rules_dict_dc.webapp_ 11.1.1oracle.soa.rules_dict_dc.webapp.war file.
3.
In the project that has to be deployed where you create the EAR file:
a.
Add the following lines to the weblogic-application.xml: library-ref
library-nameoracle.ruleslibrary-name library-ref
b.
Add the following lines to weblogic.xml in the project WAR file: library-ref
library-nameoracle.soa.rules_dict_dc.webapplibrary-name library-ref
c.
Deploy the EAR file in the Weblogic server.
25.5 Localizing the ADF-Based Web Application
You can localize an application that is created using the Rules Editor component, Rules Dictionary Editor component, or the Rules Dictionary Editor task flow.
The steps are:
1.
Modify faces-config.xml in the project that uses the Rules Editor component. The faces-config.xml file must have the following code within the
application tag to support the available resource bundles:
locale-config default-localeendefault-locale
supported-localeensupported-locale supported-localearsupported-locale
supported-localecssupported-locale supported-localedasupported-locale
supported-localedesupported-locale supported-localeelsupported-locale
supported-localeessupported-locale supported-localefisupported-locale
supported-localefrsupported-locale supported-localehusupported-locale
supported-localeitsupported-locale supported-localeiwsupported-locale
supported-localejasupported-locale supported-localekosupported-locale
supported-localenlsupported-locale supported-localenosupported-locale
supported-localeplsupported-locale supported-localept-BRsupported-locale
supported-localeptsupported-locale supported-localerosupported-locale
supported-localerusupported-locale supported-localesksupported-locale
supported-localesvsupported-locale supported-localethsupported-locale
supported-localetrsupported-locale supported-localezh-CNsupported-locale
supported-localezh-TWsupported-locale locale-config
Using Declarative Components and Task Flows 25-57
2.
Change the browser language to the locale of your choice.
3.
You can override the locale provided by the browser and display the user interface in a specific locale. This is done by passing that locale as an attribute to the
component and modifying the f:view tag in the application using the component as shown:
f:view locale={someBean.locale} The locale specified here should be the same as the one passed to the
component using the locale attribute.
25-58 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite
Part V
Part V
Using the Human Workflow Service Component
This part describes how to use the human workflow service component. This part contains the following chapters:
■
Chapter 26, Getting Started with Human Workflow
■
Chapter 27, Designing Human Tasks
■
Chapter 28, Designing Task Forms for Human Tasks
■
Chapter 29, Using Oracle BPM Worklist
■
Chapter 30, Building a Custom Worklist Client
■
Chapter 31, Introduction to Human Workflow Services
■
Chapter 32, Integrating Microsoft Excel with a Human Task
■
Chapter 33, Configuring Task List Portlets
26
Getting Started with Human Workflow 26-1
26
Getting Started with Human Workflow
This chapter introduces human workflow concepts, features, and architecture. Use cases for human workflow are provided. Instructions for designing your first
workflow from start to finish are also provided.
This chapter includes the following sections:
■
Section 26.1, Introduction to Human Workflow
■
Section 26.2, Introduction to Human Workflow Concepts
■
Section 26.3, Introduction to Human Workflow Features
■
Section 26.4, Introduction to Human Workflow Architecture
26.1 Introduction to Human Workflow
Many end-to-end business processes require human interactions with the process. For example, humans may be needed for approvals, exception management, or
performing activities required to advance the business process. The human workflow component provides the following features:
■
Human interactions with processes, including assignment and routing of tasks to the correct users or groups
■
Deadlines, escalations, notifications, and other features required for ensuring the timely performance of a task human activity
■
Presentation of tasks to end users through a variety of mechanisms, including a worklist application Oracle BPM Worklist
■
Organization, filtering, prioritization, and other features required for end users to productively perform their tasks
■
Reports, reassignments, load balancing, and other features required by supervisors and business owners to manage the performance of tasks
Figure 26–1 provides an overview of human workflow.
26-2 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite
Figure 26–1 Human Workflow
In Figure 26–1
, the following actions occur:
■
A BPEL process invokes a special activity of the human task type when it needs a human to perform a task.
■
This creates a task in the human task service component. The process waits for the task to complete. It is also possible for the process to watch for other callbacks
from the task and react to them.
■
There is metadata associated with the task that is used by the human task service component to manage the lifecycle of the task. This includes specification of the
following:
– Who performs the task. If multiple people are required to perform the task,
what is the order?
– Who are the other stakeholders?
– When must the task be completed?
– How do users perform the task, what information is presented to them, what
are they expected to provide, and what actions can they take?
■
The human task service component uses an identity directory, such as LDAP, to determine people’s roles and privileges.
■
The human task service component presents tasks to users through a variety of channels, including the following:
BPEL Process Manager
Client Applications
Human Task Service Component
Portals Oracle
BPM Worklist
Email RSS
Clients
Identity Directory LDAP, for example
Phone and Other
Notification Channels
Service Interface
Task Definition
Client Interface
Human Task
Invoke Receive
Invoke Invoke
Deadlines and
Escalations
Roles and
Assignments
Presentation
Create Task
Task Complete
Getting Started with Human Workflow 26-3
– Oracle BPM Worklist, a role-based application that supports the concept of
supervisors and process owners, and provides functionality for finding, organizing, managing, and performing tasks.
– Worklist functionality is also available as portlets that can be exposed in an
enterprise portal.
– Notifications can be sent by email, phone, SMS, and other channels. Email
notifications can be actionable, enabling users to perform actions on the task from within the email client without connecting to Oracle BPM Worklist or
Oracle WebLogic Server.
For information about portlets, see Chapter 33, Configuring Task List Portlets.
26.2 Introduction to Human Workflow Concepts
This section introduces you to key human workflow design time and runtime concepts. This section also provides an overview of the three main stages of human
workflow design.
26.2.1 Introduction to Design and Runtime Concepts
Before designing a human task, it is important to understand the design and runtime concepts. A typical task consists of a subject, priority, task participants, task
parameters or data, deadlines, notifications or reminders, and task forms. This section provides an overview of key concepts.
26.2.1.1 Task Assignment and Routing
Human workflow supports declarative assignment and routing of tasks. In the simplest case, a task is assigned to a single participant user or group. However, there
are many situations in which more detailed task assignment and routing is necessary for example, when a task must be approved by a management chain or worked and
voted on by a set of people in parallel, as shown in
Figure 26–2 . Human workflow
provides declarative, pattern-based support for such scenarios.
Note: Human workflow design-time tasks are performed in a
graphical editor known as the Human Task Editor. The tutorial in Section 26.3.2, Designing a Human Task from Start to Finish
describes how to use this editor.
26-4 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite
Figure 26–2 Participants in a Task
26.2.1.1.1 Participant A participant is a user or set of users in the assignment and
routing policy definition. In Figure 26–2
, each block with an icon representing people is a participant.
26.2.1.1.2 Participant Type In simple cases, a participant maps to a user, group, or role.
However, as discussed in Section 26.2.1.1, Task Assignment and Routing,
workflow supports declarative patterns for common routing scenarios such as management
chain and group vote.The following participant types are available:
■
Single approver This is the simple case where a participant maps to a user, group, or role.
For example, a vacation request is assigned to a manager. The manager must act on the request task three days before the vacation starts. If the manager formally
approves or rejects the request, the employee is notified with the decision. If the manager does not act on the task, the request is treated as rejected. Notification
actions similar to the formal rejection are taken.
■
Parallel This participant indicates that a set of people must work in parallel. This pattern is
commonly used for voting. For example, multiple users in a hiring situation must vote to hire or reject an
applicant. You specify the voting percentage that is needed for the outcome to take effect, such as a majority vote or a unanimous vote.
■
Serial This participant indicates that a set of users must work in sequence. While
working in sequence can be specified in the routing policy by using multiple participants in sequence, this pattern is useful when the set of people is dynamic.
The most common scenario for this is management chain escalation, which is done by specifying that the list is based on a management chain within the specification
of this pattern.
■
FYI For Your Information
Getting Started with Human Workflow 26-5
This participant also maps to a single user, group, or role, just as in single approver. However, this pattern indicates that the participant just receives a
notification task and the business process does not wait for the participant’s response. FYI participants cannot directly impact the outcome of a task, but in
some cases can provide comments or add attachments.
For example, a regional sales office is notified that a candidate for employment has been approved for hire by the regional manager and their candidacy is being
passed onto the state wide manager for approval or rejection. FYIs cannot directly impact the outcome of a task, but in some cases can provide comments or add
attachments.
For more information, see Section 27.3.6, How to Assign Task Participants.
26.2.1.1.3 Participant Assignment A task is work that must be done by a user. When you
create a task, you assign humans to participate in and act upon the task. Participants can perform actions upon tasks during runtime from Oracle BPM Worklist, such as
approving a vacation request, rejecting a purchase order, providing feedback on a help desk request, or some other action. There are three types of participants:
■
Users You can assign individual users to act upon tasks. For example, you may assign
users jlondon or jstein to a particular task. Users are defined in an identity store configured with the SOA Infrastructure. These users can be in the embedded
LDAP of Oracle WebLogic Server, Oracle Internet Directory, or a third party LDAP directory.
■
Groups You can assign groups to act upon tasks. Groups contain individual users who can
claim and act upon a task. For example, users jcooper and fkafka may be members of the group LoanAgentGroup that you assign to act upon the task.
As with users, groups are defined in the identity store of the SOA Infrastructure.
■
Application roles You can assign users who are members of application roles to claim and act upon
tasks. Application roles consist of users or other roles grouped logically for
application-level authorizations. These roles are application-specific and are defined in the application Java policy store rather than the identity store. These
roles are used by the application directly and are not necessarily known to a Java EE container.
Application roles define policy. Java permissions can be granted to application roles. Therefore, application roles define a set of permissions granted to them
directly or indirectly through other roles if a role is granted to a role. The policy can contain grants of application roles to enterprise groups or users. In the
jazn-data.xml file of the file-based policy store, these roles are defined in app-role elements under policy-store and written to
system-jazn-data.xml at the farm level during deployment. You can also define these roles after deployment using Oracle Enterprise Manager Fusion
Middleware Control. You can set a task owner or approver to an application role at design time if the role has been previously deployed.
For more information about Oracle BPM Worklist, see Section 26.2.1.6, Task Forms.
26-6 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite
26.2.1.1.4 Ad Hoc Routing In processes dealing with significant variance, you cannot
always determine all participants. Human workflow enables you to specify that a participant can invite other participants as part of performing the task.
For more information, see Section 27.3.7.1.1, Allowing All Participants to Invite Other
Participants.
26.2.1.1.5 Outcome-based Completion of Routing Flow By default, a task goes from starting
to final participant according to the flow defined in the routing policy as shown in Figure 26–2
. However, sometimes a certain outcome at a particular step within a task’s routing flow makes it unnecessary or undesirable to continue presenting the
task to the next participants. For example, if an approval is rejected by the first manager, it does not need to be routed to the second manager. Human workflow
supports specifying that a task or subtask be completed when a certain outcome occurs.
For more information, see Section 27.3.7.1.2, Stopping Routing of a Task to Further
Participants.
26.2.1.2 Static, Dynamic, and Rule-Based Task Assignment
There are different methods for assigning users, groups, and application roles to tasks.
■
Assign tasks statically You can assign users, groups, and application roles statically or by browsing the
identity service. The values can be either of the following:
– A single user, group, or application role for example, jstein,
CentralLoanRegion, or ApproverRole.
– A delimited string of users, groups, or application roles for example, jstein,
wfaulk, cdickens.
■
Assign tasks dynamically You can assign users, groups, and application roles dynamically using XPath
expressions. These expressions enable you to dynamically determine the task participants at runtime. For example, you may have a business requirement to
create a dynamic list of task approvers specified in a payload variable. The XPath expression can resolve to zero or more XML nodes. Each node value can be either
of the following:
– A single user, group, or application role
– A delimited string of users, groups, or application roles. The default delimiter
for the assignee delimited string is a comma ,. For example, if the task has a payload message attribute named po within which
the task approvers are stored, you can use the following XPath expression:
– task:tasktask:payloadpo:purchaseOrderpo:approvers
– ids:getManagerjstein, jazn.com
This returns the manager of jstein.
– ids:getReporteesjstein, 2, jazn.com
This returns all reportees of jstein up to two levels.
– ids:getUsersInGroupLoanAgentGroup, false, jazn.com
This returns all direct and indirect users in the group LoanAgentGroup.