4 Managing Workflows

This chapter provides task information as well as conceptual and reference information for using the workflow functionality available with Content Server.

This chapter contains the following topics:

4.1 Introduction to Workflows

This section provides an overview to workflows, their uses, and the advantages they can provide for your business operation. It discusses the following topics:

4.1.1 Workflow Overview

Workflows are used to specify how content is routed for review, approval, and release to the system.

For example, using a workflow ensures that the appropriate people in the Legal Department, Human Resource Department, and in upper management review and approve new policies before being released on the organization's intranet. Or a workflow could be set up to obtain timely approval and sign-off on marketing campaigns that are produced in-house. Users receive e-mail notification when content in a workflow is ready for review.

Designing an effective workflow is an iterative process. Workflows are planned, refined, and re-defined as the process is implemented. Good planning in the beginning can eliminate many problems before the workflow is enabled. See "Planning a Workflow" for details about the planning process.

4.1.1.1 Types of Workflows

There are three types of workflows:

  • A criteria workflow is used for content that enters a workflow automatically based on metadata that matches predefined criteria.

  • A basic workflow defines the review process for specific content items, and must be initiated manually.

  • In addition to these two basic types, sub-workflows can be used. Sub-workflows do not have an initial contribution step, but are entered via a workflow jump. They are created in the same manner as criteria workflows. Sub-workflows are useful for splitting large, complex workflows into manageable pieces.

4.1.1.2 Workflow Advantages and Disadvantages

Setting up workflows for your business processes can provide several advantages:

  • Workflows provide good reporting metrics; by using workflows, an audit trail can be created of who signed off on content at various points of the life cycle of the content.

  • Workflows help you get the right information to the relevant person, and the relevant information to the right person.

  • Designing a workflow forces you to examine and understand your business processes, helping you find areas that can be improved.

The same elements that provide advantages can also be disadvantages: you will be forced to examine your business processes and map out how you want to use workflows. This can be a time-consuming process, but the end result is worth it.

4.1.2 Workflow Steps

Steps define the process and the functionality of the workflow. Each workflow can include multiple review and notification steps, and multiple reviewers can be assigned to approve or reject the content at each step. For each step in a workflow, a set of users and a step type must be defined.

The users defined for a step can perform only the tasks allowed for that step type:

Step Type Description
Contribution The initial step of a Basic workflow. Administrators define the contributors when the workflow is created.
Auto-Contribution The initial step of a Criteria workflow. There are no predefined users involved in this step. The contributor who checks in a content item that enters the workflow process automatically becomes part of the workflow.
Review Users can only approve or reject the content; editing is not allowed.
Review/Edit Revision Users can edit the content if necessary and then approve or reject it, maintaining the revision.
Review/New Revision Users can edit the content if necessary and then approve or reject it, creating a new revision.

After a workflow is enabled, it goes through several specific stages:

  • When a content item is approved by the minimum number of reviewers for a particular step, it goes to the next step in the workflow.

  • If the step is defined with 0 approvals required, the reviewers are notified, but the content goes to the next step automatically. This is useful to ensure that the proper people are aware that an item is in the workflow process.

  • If any reviewer rejects the content, it goes back to the most recent Review/Edit Revision or Review/New Revision step. If there is no such step, the content goes back to the original author.

  • Depending on how the edit criteria is defined, the most recent Review/Edit Revision or Review/New Revision step may result in a new revision or an updated revision.

  • A revision may be released to the system:

    • After it exits the workflow: When content is approved at the last step in the workflow, the content item is released to the system.

    • Before it exits the workflow: When you set up a side effect that releases a document from edit state, the document is available for indexing, searching, and archiving. This is useful primarily for business routing that doesn't require publishing to the web, for example an expense report.

  • Generally, if a Basic workflow contains multiple content items, none of them will be released to the system until all of the items have been released from completion of the workflow. However, if you release a content item from edit state as a side effect, that content item can be released without waiting for all items in the Basic workflow.

The standard workflow process can be customized and made more flexible by using jumps, tokens, and aliases. These are discussed fully in "Customizing Workflows".

  • Tokens and aliases provide flexibility in specifying users in a workflow. Tokens are variables that can be used to designate unknown users and aliases can be used to include a group of people in a workflow step.

  • Jumps enable you to create conditional statements that can branch content through different paths in the same workflow, or can send content items from a Criteria or sub-workflow to a different Criteria or sub-workflow.

  • Exit conditions enable you to create conditional statements that can prevent content from moving to the next step unless certain conditions are met. This is useful when metadata could be changed by an external process during a workflow step.

  • You can also create a custom metadata field and use it to trigger different workflows.

The following illustration shows a general workflow process.

Figure 4-1 Workflow Process

Surrounding text describes Figure 4-1 .

4.1.2.1 Events

Each step in a workflow has three events: entry, update, and exit.

  • An entry event script is evaluated upon entering the step. If the entry event script does not result in a jump or exit, any users, aliases, and tokens are evaluated, and e-mail notifications are sent.

  • An update event script is evaluated at various points (for example, during the hourly update cycle or on checkin of the revision). Extra exit conditions are evaluated each time the update event script is evaluated.

  • An exit event script is evaluated when a revision has completed the step's approval requirements and the step's extra exit conditions are met.

Jumps are discussed in more detail in "Jumps and Events".

Important: :

Update and exit event scripts are not run when a revision is rejected. Any code that is to be evaluated upon rejection must be located in the entry event script for the step that the rejected content is sent to.

4.1.2.2 Workflow Files

This section discusses the files that are created as you initiate and use workflows.

4.1.2.2.1 Companion File

The companion file is a text file that maintains information about the state of a revision in a workflow. It is only active for the life of the workflow.

  • The companion file keeps track of the steps that the revision has been through and maintains the current values of workflow variables.

  • Each revision in a workflow has a companion file, which exists as long as the revision remains in the workflow. When a revision is released from a workflow, the corresponding companion file is deleted.

  • Companion files are located in the DomainHome/ucm/cs/data/workflow/states/ directory. These files are in the HDA file format, and are named by Content ID (for example, HR_004.hda).

  • Each companion file contains two sets of data:

    • The LocalData Properties section defines the Parent List and other workflow variables.

    • The WorkflowActionHistory ResultSet section contains a record of the steps, workflow actions, and users that have been involved in the revision's workflow history.

Companion files are deleted when the content item is released from the workflow. To retain a companion file, add the IsSaveWfCompanionFiles configuration variable to your/config/config.cfg file and set the parameter to TRUE. For more details, see the Oracle Fusion Middleware Idoc Script Reference Guide.

4.1.2.2.2 Keys

The companion file uses keys to keep track of workflow variables. For example, the following keys define the value of the EntryCount and Last Entry variables for an "Editor" step in a workflow called Marketing Brochures:

Editor@Marketing Brochures.entryCount=1
Editor@Marketing Brochures.lastEntryTs={ts '2001-05-02 16:57:00'}
4.1.2.2.3 Parent List

The companion file maintains a parent list, which lists the sequence of steps that the revision has been to, starting with the current step and working backward. The parent list is used to determine which step to return to when a file is rejected, when the last step of a workflow is finished, or when an error occurs. For example, the following parent list shows the Marketing Team, Editor, and Graphic Artist steps of the Marketing Brochures workflow:

WfParentList=Marketing Team@Marketing Brochures#Editor@Marketing Brochures#Graphic Artist@Marketing Brochures#contribution@Marketing Brochures

An asterisk (*) in front of a step name in the parent list indicates a jump step.

4.1.3 Workflow Step Evaluation Process

When a revision enters a workflow step, it goes through the following process:

  1. The entry script is evaluated.

    • The default entry script that keeps track of the entry count and last entry is updated.

    • Actions (such as additional user notification) are executed.

    • If the jump condition is met and a target step is defined, the revision jumps to another step.

    • If the jump condition is not met, reviewers for the current step are notified that the revision is ready for approval.

    • To avoid infinite loops, the entry script of a previously visited step is ignored. The only exception to this is when the step has been restarted using the wfCurrentStep(0) symbolic step.

  2. When the required number of reviewers have approved the revision, the exit script is evaluated.

    • If there is no exit script, the revision goes to the next step in the workflow.

    • If an exit script jump condition is met and a target step is defined, the revision jumps to another step.

  3. After the exit script is evaluated, the current action state (the wfAction workflow variable) is set. The following are the possible actions:

    • APPROVE

    • REJECT

    • CHECKIN

    • CONVERSION

    • META_UPDATE

    • TIMED_UPDATE

    • RESUBMIT

  4. As a revision moves through the steps of a workflow, each step is added to the parent list. If the revision revisits a step, the parent list "unwinds", or returns to the state it was in when the revision first visited that step. For example:

    Revision goes to: Parent list
    Step1 Step1
    Step2 Step1#Step2
    Step3 Step1#Step2#Step3
    Step2 Step1#Step2

  5. If a revision is rejected, the parent list is checked for the most recent Reviewer/Contributor step, and the revision goes to that step in the workflow.

  6. When a revision completes the last step in a workflow, the parent list is checked for the most recent jump step with a defined return step. If a return step is found, the revision goes to that step. If there are no jump steps in the parent list, or none of the jump steps have a return step defined, the revision exits the workflow.

4.1.3.1 Status of Items in Workflows

Content items that are in a workflow can have the following statuses:

Status Criteria Workflow Basic Workflow
EDIT The content item has been rejected and returned to the initial contribution step. The content item is in the initial contribution step, or the content item has been rejected and returned to the initial contribution step.
REVIEW The content item is in the review process. The content item is in the review process.
PENDING N/A The content item has completed all the workflow steps, but other content items in the workflow are not finished. This status occurs only when the workflow includes more than one content item.
DONE The content item in the workflow is finished. All of the content items in the workflow are finished.
GENWWW The content is being converted to web-viewable format. The content is being converted to web-viewable format.
RELEASED The revision is available in the content server. The revision is available in the content server.

4.1.4 Workflow Participation

When participating in a Basic workflow, email is sent to the contributors who need to check in the designated content. Email is also sent to reviewers who are involved in the different steps of a workflow.

The Workflow Content Items page identifies the actions to perform in the workflow. This can be accessed via the Content Management tray, under Active Workflows. Reviewers can review content, reject or approve content, and view information about the content and the workflow.

If the content is rejected, the Reject Content Item page is displayed. Reviewers can enter a message explaining the reason for rejection. That message is sent to the reviewers assigned to the last step allowing a contribution. Those reviewers can then check out the content, edit it and check the content back in. On the Content Check In form, the reviewer should check the Revision Finished Editing box. The content then goes to the next step in the workflow. If the box is not selected, the content remains in Review status and must be approved before moving on through the workflow.

It is good practice to discuss workflows with the people involved so they are aware of the responsibilities they will have in the process. More information about workflow participation is available in the Oracle Fusion Middleware User's Guide for Content Server.

4.2 Planning a Workflow

This chapter describes the steps you should follow to choose a workflow type and plan the workflow. The following topics are discussed:

4.2.1 Pre-design Questions

Before beginning to design a workflow, evaluate how your processes already operate. You may be able to adapt current processes into the workflow. For example, if you already use email loops to manage information between users on a project, can you incorporate that type of scenario into a workflow design?

Is the workflow being used to validate information? Or is it used for collaboration? What specific problem is it addressing? Once you understand the current processes and their shortcomings, you can make certain to design the workflow to solve the problem.

Ask yourself the following questions when you start to design your workflow:

  • Who should be involved in the workflow? What users will receive notification that an item is ready for review? Who will have edit permissions on an item? Who will have final sign-off on an item?

    Equally important is to ask who should be left out of a workflow?

    How will you train the people who are involved in the workflow?

  • What happens when an item is in the workflow? What action will be taken when an item is approved, rejected, or updated? What should occur when an item stays in a workflow too long?

  • When does an item need to be escalated to the next stage of a workflow? What is the criteria for determining when a workflow is completed?

  • Where do users go to participate in a workflow? Will it be done via a Web interface or some other interface of your design?

  • How are approvals and rejections handled? Will you store audit information? Do you need to make provision for approval authentication (a digital signature)?

4.2.2 Choosing a Workflow Type

Consider the following points when you decide which type of workflow to use.

Use a Basic Workflow when you need to:

  • Specify an 'ad hoc' workflow, one that does not depend on specific criteria to be enabled.

  • Route multiple content items to go through the same series of steps. The items go through the steps individually, but are not released at the end of the cycle until all items are finished in the workflow.

  • Notify or remind a user to contribute a content item to the workflow.

  • Submit items to a workflow manually.

  • Specify a workflow that is used infrequently.

  • Use a Basic workflow to set up a unique review process or to set up the review process for a group of related content items.

  • Specify a user to start the workflow. Content can enter a Basic workflow only when a user with Workflow rights starts the workflow.

Use a Criteria Workflow when you need to:

  • Have content enter a workflow automatically.

  • Route single content items that match specific criteria. You can route multiple items that match the criteria but they do not progress through the workflow as a unit.

  • Set up a standardized review process for individual documents.

  • Specify a workflow that is used frequently.

  • Open the workflow to many users. Users do not need Workflow rights for their content to enter a Criteria workflow.

When deciding which type of workflow to use, keep the following key points in mind:

  • If content is checked in with the wrong security group or wrong metadata value, it can enter a Criteria Workflow accidentally.

  • If users are frequently processing content through the same Basic workflow, consider setting up a Criteria workflow to automate the process.

  • You cannot use the same or overlapping criteria for multiple workflows. If a content item matches the criteria for more than one workflow, it will enter the first workflow in the list.

4.2.2.1 Security Issues

Keep the following security issues in mind when administering workflows:

  • Each workflow is associated with a security group.

    • For a Criteria workflow, only content items that are in the same security group will enter the workflow.

    • For a Basic workflow, new content items will be assigned to the security group of the workflow, and existing content items must belong to the workflow's security group.

  • A workflow can only jump to another workflow belonging to the same security group.

  • The security group of a workflow cannot be changed while the workflow is active. However, the security group of a content item currently in the workflow process can be changed.

  • To set up a workflow and start or enable the workflow process, you must have Workflow rights and admin permission for the security group of the content items.

  • To set up a workflow you can use a workflow template to initiate contribution steps.

  • To participate in a workflow as a contributor, you must have Write permission to the workflow's security group.

4.2.3 Designing a Workflow

To design a workflow:

  1. Draw a flowchart of the workflow. (See the flowcharts for the "Criteria Workflow Process" and "Basic Workflow Process" for examples.)

  2. Verify that you have all the metadata needed for the workflow. If not, you should create the necessary metadata prior to setting up the workflow.

  3. Set up any aliases you will need for the workflow. Alias creation is discussed in the Oracle Fusion Middleware System Administrator's Guide for Content Server.

  4. Set up any tokens you will need for the workflow. See "Creating a Token" for details.

  5. Set up a Basic or Criteria workflow. If workflow templates are available, consider using a template as a starting point. See "Workflow And Script Templates" for details.

  6. Set up sub-workflows as necessary.

  7. Set up jumps as necessary. See "Setting Up Jumps" for details.

    • If script templates are available, use them to create the step event scripts.

    • If jumps will be used, consider setting up a "master" workflow with sub-workflows for each jump.

  8. Test the workflow.

    • For a Criteria workflow, check in a test document that matches the defined security group and metadata field value.

    • For a Basic workflow, define test content and start the workflow.

    • Simulate as many approval/rejection scenarios as possible.

    • For workflows that contain jumps, simulate as many event scenarios as possible.

    • Include reviewers in the workflow testing to verify that people understand their roles.

4.2.4 Modifying Workflows

After you have created a workflow, you can change some aspects of the workflow, but not others. If you disable a Criteria workflow or cancel a Basic workflow in order to add or delete steps, any content in the workflow is released (Criteria) or deleted (Basic).

Keep these points in mind as you design your workflow:

You can:

  • Modify the criteria for a Criteria workflow.

  • Add or delete content items from a Basic workflow.

  • Modify step definitions (including reviewers, exit conditions, and events)

You cannot:

  • Simply change the order of the steps. You can delete a step and re-create it in a different place, however.

  • Simply add steps in the middle of the workflow (new steps are always added to the end of the workflow).

The following tips may help you modify existing workflows. The complexity of these processes points to the need to carefully design workflows before they are implemented. Altering one while it is in use can be a time-consuming and difficult process.

  • If you need to reorder steps in an existing workflow, consider the following options:

    • Create a sub-workflow and add a jump to it from an existing step. (See "About Jumps" for more information.) You can make this change to an existing step without disabling or canceling the workflow. This option should be considered a short-term fix until you can disable or cancel the workflow and rebuild it as necessary.

    • Add step event scripts to an existing step to define the actions that would normally take place in a separate step. (See "Jumps and Events" for more information.) You can make these changes to an existing step without disabling or canceling the workflow. This option should be considered a short-term fix until you can disable or cancel the workflow and rebuild it as necessary.

  • If you must disable a workflow in order to modify it (for example, to add a step) all content is immediately released from the workflow.

    To disable a workflow without releasing content first clone the workflow to a static workflow which has the same step sequence as the original workflow but which has no step logic. The content will go into a step and stay there until moved.

    Next create an update event in the original workflow. This event is triggered by time and pushes the content into the cloned static workflow at the appropriate step.

    When the content is out of the original workflow you can disable the workflow, make the necessary changes then re-enable it. Then use the same timed event logic to move the content from the cloned workflow back to the original workflow.

4.3 Creating a Criteria Workflow

Criteria workflows are used to set up a standardized review process for individual documents. They define the review process for content that enter the workflow automatically when they match predefined criteria. For example, any time a new purchase order is generated, it might be automatically routed to specific reviewers for approval.

A Criteria workflow includes the following:

  • Criteria defined by a security group and one metadata field.

  • Auto-contribution step with no predefined users.

  • One or more reviewer steps with one or more reviewers per step.

A sub-workflow is a workflow that does not have an initial contribution step. Sub-workflows are useful for splitting large, complex workflows into manageable pieces.

Content can enter a sub-workflow only through a jump from a Criteria workflow.

This section discusses the following topics:

Concepts

Tasks

Sub-workflows are set up using the same procedure as Criteria workflows with a few minor exceptions. Those exceptions are noted in the procedure for setting up Criteria workflows.

4.3.1 Criteria Workflow Process

The following steps briefly explain the Criteria workflow process:

  1. A user with Workflow rights sets up the Criteria workflow by defining the following:

    • Security group

    • Metadata field and value (for example, ContentType matches PurchaseOrder)

    • Review steps and reviewers for each step

    • The number of approvals required for each step. For example, do all reviewers need to approve it before it can move to the next step?

    • If a group of people need to be included in an alias or if a token should be set up, perform those tasks ahead of time.

  2. A user with Workflow rights starts the Criteria workflow by enabling it.

  3. When content is checked in with the defined security group and metadata field value, the content enters the workflow.

  4. Reviewers for the first step are notified by e-mail that the revision is ready for review.

  5. The reviewers approve or reject the revision.

    • If the step is a reviewer/contributor step, the reviewers can check out the revision, edit it, and check it back in before approving it. For example, editors may need to alter the content of an item in the workflow.

    • If a user rejects the revision, the workflow returns to the previous contribution step, and the users for that step are notified by e-mail.

    • When the minimum number of users have approved the revision, it goes to next step. (If the minimum number of approvals is 0, the revision moves to the next step automatically.)

  6. When all steps are complete, the revision is released to the system.

    Figure 4-2 Criteria Workflow Process

    Surrounding text describes Figure 4-2 .

4.3.2 Criteria Workflow Tips

Each Criteria workflow must have unique criteria. If a content item matches the criteria for two different workflows, it will enter the first workflow in the list of defined workflows.

  • All users assigned to the Criteria workflow must have Read permission to the selected security group. Contributors must have Write permission to the selected security group to be able to check the revision in and out.

  • You cannot add or delete steps while a Criteria workflow is enabled.

  • Any content items checked in while a Criteria workflow is disabled will bypass the workflow process and be released to the system.

  • Disabling a Criteria workflow releases any revisions still in the workflow process to the system.

  • A Criteria workflow can use jumps to sub-workflows and other Criteria workflows in the same security group, and can jump to other steps in the same workflow.

  • Consider making at least one step in the workflow a Reviewer/Contributor step so that rejected revisions go back to that step rather than back to the original author.

4.3.3 Setting Up a Criteria Workflow

Keep these points in mind when setting up a criteria workflow:

  • All users assigned to the workflow must have Read permission to the selected security group, and Contributors must have Write permission. If the security group of a checked in item does not match the security group of the workflow, the item will not enter the workflow.

  • Define aliases and tokens before setting up your workflow.

  • When you use a template, you may use the reviewers from the selected template.

  • Make sure that the criteria is not the same as for any other Criteria workflows. If a content item matches the criteria for two different workflows, it will enter the first workflow in the list of workflows.

  • If you select Content ID as the Field and your content server uses an Oracle database, you must enter all uppercase characters for the Value. All other fields can have mixed case.

  • Also, if you select ContentID as the Field, you can select an existing content item by clicking Select below the Value field.

  • You can enter zero (0) in the At least this many reviewers field to notify reviewers that the revision has reached the step, but reviewers will not be able to approve, reject, or edit the revision at that step. The workflow will pass to the next step automatically.

Follow these steps to create a Criteria workflow or sub-workflow:

  1. Display the Workflow Admin: Criteria Tab from the Workflow Admin applet.

  2. Click Add.

    The New/Edit Criteria Workflow Screen is displayed.

  3. Enter a name in the Workflow Name field. The Workflow Name has a maximum field length of 30 characters and cannot contain special characters (; @ &, and so on). The workflow name cannot be changed after the workflow is created.

  4. Enter a detailed description for the workflow in the Description field.

  5. Select the Security Group from the list. This is the security group to which the content items in this workflow belongs.

  6. Select an option from Original Author Edit Rule. This specifies whether to permit the original author to edit the existing revision or create a new revision if the content item is rejected.

  7. If you want to use a workflow template, select the Use Template check box and select the template name. This box is displayed only if a template currently exists. See "Workflow And Script Templates" for details.

  8. Determine the type of workflow:

    • To create a Criteria workflow, select the Has Criteria Definition check box.

    • To create a sub-workflow, clear the Has Criteria Definition check box.

    You can change the type of workflow later by clearing or selecting the Has Criteria Definition check box

  9. For a Criteria workflow, define the criteria by choosing the appropriate Field, Operator, and Value. For example, Review Process matches HRBenefits.

  10. Click OK.

  11. If a template was not used to create steps, or if you want to add another step, click Add in the right pane of the Workflow Admin screen. The Add New/Edit Step Screen is displayed.

  12. Enter an appropriate Name and Description for the step. The name cannot be changed after the step is created. The name is usually descriptive of the step (for example, EditorialReview or TechnicalReview).

  13. Specify the authority level of the users for the step:

    • Users can review the current revisionUsers can approve or reject the revision but cannot edit the revision.

    • Users can review and edit (replace) the current revision—Users can edit the revision, approve it, or reject it. Any edit will not update the revision of the content item.

    • Users can review the current revision or create new revision—Users can edit the revision, approve it, or reject it. Any edit will update the revision of the content item. This preserves the original content and provides an audit trail of changes.

  14. Select the type of users to be added to the step. More than one type of user can be defined for a step:

    • To add a group of users defined by an alias, click Add Alias. The Add Alias to Step Screen is displayed. Choose the alias from the displayed list.

    • To add individual user logins, click Add User. The Add User to Step is displayed.

      • To narrow the list of users, select the Use Filter check box, click Define Filter, select the filter criteria, and click OK.

      • To select a range of users, click one user and then hold down the Shift key while clicking another user name.

      • To select users individually, hold down the Ctrl key while clicking each user name.

    • To add a variable user defined by a token, click Add Token. The Add Token to Step screen is displayed. See "Creating a Token" for details about creating tokens.

  15. Click OK.

  16. Click the Exit Conditions tab.

  17. Specify how many reviewers must approve the revision before it passes to the next step.

    • To require approval by all reviewers, select All reviewers.

    • To specify a minimum number of reviewers who must approve the revision, select At least this many reviewers and enter the number.

  18. Typically, exit conditions are useful when metadata could be changed by an external process during the workflow step. Use the following instructions if the step requires additional exit conditions to be able to pass to the next step:

    1. Select the Use Additional Exit Condition check box.

    2. Click Edit.

      The Edit Additional Exit Condition Screen is displayed. You can use this screen to select additional criteria from option lists.

    3. Select a workflow condition or a metadata field from the Field option list.

    4. Select an operator from the Operator option list. This is a dependent choice list that shows operators associated with the Field.

    5. Select a value from the Value option list. This is a dependent list based on the option chosen as the Field.

    6. Click Add to add the conditional statement to the Condition Clause. The clause appears in the Condition Clause box. Multiple clauses can be appended with AND statements.

    7. Repeat for as many conditions as required. To modify an expression, select it in the Condition Clause box, change the Field, Operator, or Value, and click Update.

    8. To modify the condition expression, select the Custom Condition Expression check box and edit the script (for example, use OR not AND for a condition). The additional exit conditions must be Idoc Script statements that evaluate to true or false. Do not enclose the code in Idoc Script tags <$ $>.

      Caution:

      If you clear the Custom Condition Expression check box, the expression reverts to its original definition; all modifications are lost.
    9. Click OK.

  19. If the workflow requires conditional steps or special processing, click the Events tab and add the appropriate scripts. See "Setting Up Jumps" for more information.

  20. Click OK.

  21. Add, edit, and delete steps as necessary to complete the workflow.

    • To add another step to the workflow, repeat steps 11 through 20.

    • To edit an existing step, select the step and click Edit.

    • To delete an existing step, select the step and click Delete.

  22. Make sure that the correct workflow is selected in the left pane, and click Enable.

    A confirmation screen is displayed.

  23. Click Yes to activate the selected workflow.

4.3.4 Changing a Criteria Workflow or Sub-workflow

To change an existing Criteria workflow or sub-workflow:

  1. Display the Workflow Admin: Criteria Tab.

  2. Select the workflow you want to change in the left pane.

  3. If you want to add or delete steps, disable the workflow.

  4. Use the Add, Edit, and Delete buttons in the left and right panes to change the following:

    • workflow description

    • security group

    • type of workflow (Criteria or sub-workflow)

    • criteria

    • step description

    • type of step (reviewer, contributor same revision, contributor new revision)

    • users

    • events

    • number of approvals required

    • exit conditions

    You can add users to a step while the Criteria workflow is enabled, but if any revisions are currently at that step in the workflow, the new users will not be notified immediately. They will be notified once the scheduled workflow system event occurs. This does a TIMED_UPDATE on all items in the workflow.

  5. If the workflow is disabled, make sure that the correct workflow is selected in the left pane and click Enable.

    A confirmation screen is displayed.

  6. Click Yes to activate the selected workflow.

4.3.5 Disabling a Criteria Workflow or Sub-workflow

To disable a criteria workflow or sub-workflow:

  1. Display the Workflow Admin: Criteria Tab.

  2. Select the workflow.

  3. Click Disable.

  4. If there are any content items still in the workflow process, you will be notified that all of the content revisions will be released. If you don't want to release the content, click No.

  5. Click Yes to disable the workflow.

    The status of the workflow changes to Disabled.

4.4 Creating a Basic Workflow

A Basic workflow defines the review process for specific content items. It is different from a Criteria workflow in that you do not need to define criteria for content to enter the workflow. A Basic workflow is set up and initiated manually.

A Basic workflow includes the following:

  • One or more content items.

  • Initial contribution step with one or more contributors.

  • Zero or more review steps with zero or more reviewers per step.

This section discusses the following topics:

4.4.1 Basic Workflow Process

The following steps explain the Basic workflow process:

  1. A user with Workflow rights sets up the Basic workflow by defining the following items:

    • Content: New content can be created and/or existing content can be selected. After going through the workflow, new content is released to the system at revision 1, and existing content is released to the system at the next revision number for that content item.

    • Initial contributors

    • Review steps, reviewers for each step and number of approvals required for each step.

  2. A user with Workflow rights starts the Basic workflow by enabling it.

  3. An e-mail is sent to the contributors.

  4. Any of the contributors can check out and then check in a file for each content item in the workflow.

  5. Reviewers for the first step are notified by e-mail that the revisions are ready for review.

  6. The reviewers approve or reject the revisions.

    • If the step permits editing, the reviewers can check out the revisions, edit them, and check them back in before approving it.

    • If a user rejects a revision, the revision returns to the previous contribution step, and the users for that step are notified by e-mail.

    • When the minimum number of users have approved the revision, it goes to next step. (If the minimum number of approvals is 0, the revision moves to the next step automatically.)

  7. Generally, if a Basic workflow contains multiple files, none of them will be released to the system until all of the files have been released from completion of the workflow. Completed content items stay in PENDING status until the last revision is approved. However, if you release a content item from edit state as a side effect, that content item can be released without waiting for all items in the Basic workflow.

  8. When all steps are complete and all revisions are approved, the revisions are released to the system.

Figure 4-3 Basic Workflow Process

Surrounding text describes Figure 4-3 .

4.4.2 Basic Workflow Tips

  • For new content, the Content ID defined in the workflow is the Content ID that will be applied when the revision is released to the system. The Content ID cannot be changed after it is created.

  • You cannot add a content item to multiple basic workflows. This will cause an error message to appear and the workflow will not be enabled.

  • New content will be assigned to the security group of the Basic workflow.

  • The security group of an existing revision must match the security group of the Basic workflow.

  • All users assigned to the Basic workflow must have Read permission to the selected security group. Contributors must have Write permission to the selected security group to be able to edit revisions.

  • You cannot add, edit, or delete review steps while a Basic workflow is active.

  • You can cancel an active workflow, but any revisions in the workflow are deleted from the system. Any edits that have been made to the files are lost unless they have also been saved on a local hard drive.

  • An inactive Basic workflow can be reused, but it must be started manually each time.

  • A Basic workflow can use jumps, but only to other steps in the same workflow. A Basic workflow cannot jump to a sub-workflow.

4.4.3 Setting Up a Basic Workflow

Keep these points in mind before creating a Basic workflow:

  • All users assigned to the workflow must have Read permission to the selected security group, and Contributors must have Write permission.

  • When you use a template, you must change the reviewers if they are different from those defined in the selected template.

  • Do not add a content item to multiple basic workflows. This causes errors and the workflow will not be enabled.

  • You can enter zero (0) in the At least this many reviewers field to notify reviewers that the revision has reached the step, but reviewers will not be able to approve, reject, or edit the revision at that step. The workflow will pass to the next step automatically.

Use the following steps to create a Basic workflow:

  1. Display the Workflow Admin: Workflows Tab. The default tab view is that of a Basic workflow.

  2. Click Add.

    The Add New/Edit Workflow Screen is displayed.

  3. Enter a name in the Workflow Name field. The Workflow Name has a maximum field length of 30 characters and cannot contain special characters (; @ &, and so on). The Workflow Name cannot be changed after the workflow is created.

  4. Enter a detailed description for the workflow in the Description field.

  5. Select the Security Group from the list. This is the security group to which the content items in this workflow belong.

  6. Select an option from Original Author Edit Rule. This specifies whether to permit the original author to edit the existing revision or create a new revision if the content item is rejected.

  7. If you want to use a template, select the Use Template check box and select the template name. This box is displayed only if a template exists. See "Workflow And Script Templates" for details.

  8. Click OK.

  9. To add a new content item to the workflow, click New.

    The Add Content to Workflow (New Content) Screen is displayed.

    1. Enter a Content ID for the new content item. The Content ID cannot be changed after the content item is created. To change a Content ID, delete the content item from the list and add a new content item. If you are using an Oracle database, all Content IDs are converted automatically to uppercase letters.

    2. Click OK.

  10. To add an existing content item to the workflow, click Select.

    The Add Content to Workflow (Existing Content) Screen is displayed.

    • To narrow the list of content items, specify criteria for the filter and/or release date.

    • To select a range of content items, click one item and then hold down the Shift key while clicking another item.

    • To select content items individually, hold down the Ctrl key while clicking each item.

    Existing content items must have the same security group as the workflow.

  11. Repeat steps 9 and 10 as necessary to add the desired content items to the workflow.

  12. Define one or more contributors for the initial contribution step. More than one type of user can be defined for the contribution step.

    • To add a group of users defined by an alias, click Add Alias. The Add Alias to Workflow Screen is displayed.

    • To add individual user logins, click Add User. The Add User: Basic Workflow screen is displayed.

      • To narrow the list of users, select the Use Filter check box, click Define Filter, select the filter criteria, and click OK.

      • To select a range of users, click one user and then hold down the Shift key while clicking another user.

      • To select users individually, hold down the Ctrl key while clicking each user.

  13. If a template was not used to create review steps, or if you want to add another step, click Add in the right pane near the Steps box.

    The Add New/Edit Step Screen is displayed.

  14. Enter an appropriate Name and Description for the step. The Name cannot be changed after the step is created. Use a descriptive name for the step (for example, CopyEditReview or FinalApproval).

  15. Specify the authority level of the users for the step.

    • Users can review the current revision—Users can approve or reject the revision.

    • Users can review and edit (replace) the current revision—Users can edit the revision, approve it, or reject it. Any edit will not update the revision of the content item.

    • Users can review the current revision or create new revision—Users can edit the revision, approve it, or reject it. Any edit will update the revision of the content item. This preserves the original content and provides an audit trail of changes.

  16. Select the type of users to be added to the step. More than one type of user can be defined for a step:

    • To add a group of users defined by an alias, click Add Alias. The Add Alias to Step Screen is displayed.

    • To add individual user logins, click Add User. The Add User: Basic Workflow screen is displayed. To narrow the list use the Use Filter check box; to select a range of users, click one user and then hold down the Shift key while clicking another user. name. To select users individually, hold down the Ctrl key while clicking each user name.

    • To add a variable user defined by a token, click Add Token. The Add Token: Basic Workflow screen is displayed. See "Creating a Token" for more information.

    • Click the Exit Conditions tab.

    • Specify how many reviewers must approve the revision before it passes to the next step.

    • To require approval by all reviewers, select All reviewers.

    • To specify a minimum number of reviewers who must approve the revision, select At least this many reviewers and enter the number.

  17. Typically, exit conditions are useful when metadata could be changed by an external process during the workflow step. Use the following instructions if the step requires additional exit conditions to be able to pass to the next step:

    1. Select the Use Additional Exit Condition check box.

    2. Click Edit.

    3. The Edit Additional Exit Condition Screen is displayed. You can use this screen to select additional criteria from option lists.

    4. Select a workflow condition or a metadata field from the Field option list.

    5. Select an operator from the Operator option list. This is a dependent option list that shows operators associated with the Field.

    6. Select a value from the Value option list. This is a dependent list based on the option chosen as the Field.

    7. Click Add to add the conditional statement to the Condition Clause. The clause appears in the Condition Clause box. Multiple clauses can be appended with AND statements.

    8. Repeat for as many conditions as required. To modify an expression, select it in the Condition Clause box, change the Field, Operator, or Value, and click Update.

    9. To modify the condition expression, select the Custom Condition Expression check box and edit the script (for example, use OR not AND for a condition). The additional exit conditions must be Idoc Script statements that evaluate to true or false. Do not enclose the code in Idoc Script tags <$ $>.

      Caution:

      If you clear the Custom Condition Expression check box, the expression reverts to its original definition; all modifications are lost.
    10. Click OK.

  18. If the workflow requires conditional steps or special processing, click the Events tab and add the appropriate scripts. See "Customizing Workflows" for more information.

  19. Click OK.

  20. Add, edit, and delete steps as necessary to complete the workflow.

    • To add another user to the initial contribution step, repeat step 12.

    • To delete a user from the initial contribution step, click Delete.

    • To add another review step to the workflow, repeat steps 13 through 19.

    • To edit an existing review step, select the step and click Edit.

    • To delete an existing review step, select the step and click Delete.

  21. Make sure that the correct workflow is selected in the left pane, and click Start.

    The Start Workflow Screen is displayed.

  22. Enter a message to be sent to the contributors.

  23. Click OK.

4.4.4 Changing a Basic Workflow

To change an existing Basic workflow:

  1. Display the Workflow Admin: Workflows Tab.

  2. Select the workflow you want to change in the left pane.

  3. If you want to change the workflow security group or the number of review steps in an active workflow, you must first click Cancel to cancel the workflow.

  4. Click Edit in the left pane to change the workflow description or the security group.

  5. Use the New, Select, and Delete buttons in the Content pane to add or delete content from the workflow.

  6. Use the Add Alias, Add User, and Delete buttons in the Contributors pane to add or delete contributors from the initial contribution step.

    Caution:

    You can change content items in a Basic workflow after it has been started, but the contributors will not be notified automatically. You can also change contributors in a Basic workflow after it has been started, but any new contributors will not be notified immediately.
  7. Use the Add, Edit, and Delete buttons in the Steps pane to change the following:

    • step description

    • type of step (reviewer or reviewer/contributor)

    • users

    • events

    • number of approvals required

    • exit conditions

4.5 Customizing Workflows

Tokens and jumps can be used to customize your workflows to accommodate different business scenarios. A token defines variable users in a workflow and a jump can be used to branch a workflow to a different side effect.

This section describes how to set up and use tokens and jumps. It discusses the following topics:

4.5.1 Idoc Script Functions and Variables

Jumps and tokens are created using Idoc script. The interfaces create the correct syntax and usage for you when you create tokens and jumps. However, you may wish to customize your scripts using the following Idoc Script functions. See the Oracle Fusion Middleware Idoc Script Reference Guide for complete details about usage.

Idoc Script Functions:

  • wfAdditionalExitCondition: retrieves the exit condition that has been defined for the current step.

  • wfAddUser: adds a user, alias, or workflow token to the list of reviewers for a workflow. This can only be used inside a token.

  • wfCurrentGet: retrieves a local state value from the companion file.

  • wfCurrentSet: sets the local state value of a key in the companion file.

  • wfCurrentStep: retrieves the name of a step relative to the current step.

  • wfDisplayCondition: retrieves the exit condition for a workflow step.

  • wfExit: exits a workflow step. Can be used to exit the workflow.

  • wfGet: retrieves a state value from the companion file.

  • wfGetStepTypeLabel: takes an internal workflow step value and turns it into a human-readable label.

  • wfIsReleasable: indicates if the document is released (as far as the workflow is concerned).

  • wfJumpMessage: defines a message that will be included in the notification e-mail that is issued when a jump is entered.

  • wfLoadDesign: used to retrieve information about the existing steps in a workflow or about the exit conditions in a workflow.

  • wfNotify: sends an e-mail to a specified user, alias, or workflow token.

  • wfReleaseDocument: causes a workflow to release all outstanding document revisions for a document that are currently being locked by the workflow.

  • wfSet: sets a key with a particular value in the companion file.

  • wfUpdateMetaData: defines a metadata value for the current content item revision in a workflow.

Idoc Script Variables:

  • wfAction: the action currently being performed on the revision.

  • wfJumpEntryNotifyOff: turns on/off the jump notification.

  • wfJumpName: the name of the current jump.

  • wfJumpReturnStep: the name of the step in the parent workflow that the revision returns to when exiting a workflow after the current jump.

  • wfJumpTargetStep: the name of the step where the revision will jump if the conditions are met.

  • wfMailSubject: defines the subject line of a workflow e-mail notification.

  • wfMessage: defines a message that will be included in a workflow e-mail notification.

  • wfParentList: list of the workflow steps that the revision has visited.

  • wfStart: sends the revision to the first step in the current workflow.

4.5.2 About Tokens

A token can be used to:

  • Add a variable to a workflow which is interpreted to be a specific user or class of user when the workflow is run.

  • Include users and aliases in workflow jumps.

  • Define users with conditional statements.

A token assignment is unique and local to each document in a workflow. The logic used to assign the token of one document does not affect other documents in the workflow.

Several sample workflow tokens are included in the Workflow Admin application. They can be used as is, or they can be modified to create your own workflow tokens. These tokens can be used with Content Server.

Important:

If a token does not resolve to any valid user names, the token is ignored. If no valid users are defined for a step, the revision moves to the next step in the workflow. For this reason, it is a good idea to identify at least one defined user for each step.

4.5.2.1 Token Syntax

The Idoc Script function for tokens, wfAddUser, takes two parameters:

  • User—The first parameter is the metadata field, alias name, or a variable that resolves to a user name or alias.

  • Type—The second parameter is the type of token: user or alias.

All Idoc Script commands begin with <$ and end with $> delimiters. For example:

<$wfAddUser(dDocAuthor, "user")$>
<$wfAddUser("MktTeam", "alias")$>
<$wfAddUser("myUserList", "alias")$>

See the Oracle Fusion Middleware Idoc Script Reference Guide for more information about Idoc Script syntax and usage.

4.5.3 Creating a Token

Follow these steps to create a token:

  1. From the The Workflow Admin Application, select Tokens from the Options menu.

    The Workflow Tokens Screen is displayed.

  2. Click Add.

    The Add/Edit Token Screen is displayed.

  3. Enter a token name in the Token Name field. The Token Name cannot be changed after the token is created. Try to use a descriptive name for the token (for example, GetOriginalAuthor, or AuthorManager).

  4. Enter a detailed description in the Description field.

  5. Click Add.

    The Add Token User Screen is displayed.

  6. Select User or Alias.

  7. Enter a metadata field.

    • To specify the original author of the content item, enter dDocAuthor.

    • To specify an alias, type the alias name exactly. See the Screen Aliases tab on the User Admin screen for a list of defined aliases.

  8. Click OK. The Idoc Script containing the value you specified is shown in the User window.

  9. Repeat steps 5 through 8 to add another user or alias.

  10. To create a conditional token, edit the Users field.

  11. Click OK.

4.5.4 Changing a Token

To change an existing workflow token:

  1. From The Workflow Admin Application, select Tokens from the Options menu.

    The Workflow Tokens Screen is displayed.

  2. Select the token you want to change.

  3. Click Edit.

    The Add/Edit Token Screen is displayed.

  4. Edit the token script as necessary. See "About Jumps" for more information.

  5. Click OK.

4.5.5 Deleting a Token

To delete a workflow token:

  1. From The Workflow Admin Application select Tokens from the Options menu.

    The Workflow Tokens Screen is displayed.

  2. Select the token you want to delete.

  3. Click Delete.

    A confirmation screen is displayed.

  4. Click Yes.

4.5.6 Token Examples

The following examples illustrate how tokens can be used in workflows:

Example 4-1 Original Author the Only Contributor

This example assumes that the original author is the only contributor for the file. Example 4-2 addresses the situation where different authors could check out and check in the file during the workflow process.

Suppose you want to notify the original author of each file when their content is released from a workflow into the system. You would first create a token that corresponds to the Author metadata field, which is called dDocAuthor in Idoc script. When you set up the workflow, you can create a notification step (0 approvals required) and select the token as the user for that step. The token script would look like the following example:

<$wfAddUser(dDocAuthor, "user")$>

Example 4-2 Workflow with Reviewer/Contributor Steps

If a workflow includes Reviewer/Contributor steps, it is possible that a user other than the original contributor could check in a revised file, and the dDocAuthor would no longer be the original author. In this case, you could set a workflow variable called OriginalAuthor in the companion file using custom script in the first workflow step, and specify the custom variable in the token instead of using dDocAuthor.

The event script in the first step might look like the following:

<$wfSet("originalContributor", dDocAuthor)$>
<$wfSet("type", user)$>

And the token script for the notification step would look like:

<$wfAddUser(wfGet("originalContributor"), wfGet("type"))$>

Example 4-3 Reviewers Selected Based on Jump Criteria

One typical use for tokens is to select reviewers 'on the fly', or based on the conditions of a jump. Let's say that you have a workflow set up for standard routing of all marketing materials through the Marketing department. However, you want any changes to your company catalogs to also be reviewed by the Distribution department.

You could create a jump that adds a token to the list of reviewers whenever the Type is catalog. The token script would look like:

<$wfAddUser("Dist_Dept", "alias")$>

Example 4-4 Condtional Token

Rather than creating a jump script for the previous example, you could define a conditional token that adds the Dist_Dept alias whenever the Type is catalog. The token script would look like the following:

<$if dDocType like "catalog"$>
  <$wfAddUser("Dist_Dept", "alias")$>
<$endif$>

Example 4-5 Token Specifying Management Chain

Another common use for tokens is specifying the current user's manager as a reviewer. (The manager attribute must be specified as a user information field in the content server, or as a user attribute in an external directory such as LDAP or ADSI.) The token script would look like:

<$wfAddUser(getUserValue("uManager"), "user")$>

4.5.7 About Jumps

Jumps enable you to customize workflows for your system, your content, and your users. A jump is usually a conditional statement, written in Idoc Script.

Typical uses of jumps include:

  • Specifying more than one metadata field as the criteria for entering a workflow.

  • Taking action on content automatically after a certain amount of time has passed.

  • Defining different paths for files to move through the same workflow depending on metadata and user criteria.

  • Releasing a workflow document prior to approval by using the side effect: Release document from edit state.

The following is an example of a jump that exits the workflow if the author is sysadmin:

<$if dDocAuthor like "sysadmin"$>
  <$wfSet("wfJumpName", "Entry step")$>
  <$wfSet("wfJumpTargetStep", wfExit(0, 0))$>
  <$wfSet("wfJumpEntryNotifyOff", "0")$>
<$endif$>

In most cases, a jump will include a conditional statement. However, you can create a jump that consists of non-conditional code, such as the following:

<$wfSet("custom_wf_variable", new_value)$>
  <$wfSet("wfJumpTargetStep", step_1)$>

You can use this type of jump to execute code or move a revision to another step automatically.

4.5.7.1 Jumps and Events

As mentioned in Events, each step in a workflow has an entry, update, and exit event.

A script with one or more jumps can be defined for any or all of the events in a step. Any Idoc Script defined for an event is evaluated at a specific time that depends on the type of event:

  • An entry event script is evaluated upon entering the step. Every time a step is entered, a default script is evaluated in addition to any user-defined custom script. The default script keeps track of the number of times the step has been entered (entryCount) and the last time the step was entered (lastEntryTs).

    If the entry event script does not result in a jump or exit, any users, aliases, and tokens are evaluated, and e-mail notifications are sent.

  • An update event script is evaluated and triggered by a state change of the content, such as the workflow update cycle, the update of the revision's metadata or approval or checkin of the revision.

    Extra exit conditions are evaluated each time the update event script is evaluated.

  • An exit event script is evaluated when a revision has completed the step's approval requirements and the step's extra exit conditions are met.

By default, the workflow update cycle occurs hourly. This cycle time can be increased in increments of one hour (using the WorkflowIntervalHours configuration setting), but cannot be reduced to less than one hour. To have update scripts evaluated more often or in response to other events, you could initiate a metadata update cycle without changing any metadata.

Figure 4-4 Jumps and Events

Surrounding text describes Figure 4-4 .

4.5.7.2 Rejected Content

Within a single workflow, when a reviewer rejects a revision the content item is routed back to the most recent contribution step.

However, when a jump is made to a sub-workflow or other workflow and content is rejected there, different behavior occurs. The process returns to the parent workflow, not to the previous contribution step.

Important:

Update and exit event scripts of the current step are not run when a revision is rejected. Any code that is to be evaluated upon rejection must be located in the entry event script for the step that the rejected file is sent to.

4.5.7.3 Side Effects

Side effects are the actions that take place when a revision in a workflow step meets the jump condition. Side effects can include:

  • jumping to another step in the same workflow

  • jumping to a step in a sub-workflow or other Criteria workflow (for Criteria workflows only)

  • notifying users

  • exiting the workflow

  • setting state information in the companion file

  • releasing a workflow document prior to approval

Side effects can be generated automatically by selections on the Script Properties Screen and Add/Edit Jump Screen, and custom side effects can be specified in the Custom Effects field on the Add/Edit Jump Screen.

4.5.8 Jump Variables and Steps

A jump can include a target step, which tells the workflow where to go to if the content meets the jump condition. The following is an example of a target step that sends the content to the next step in the workflow:

<$wfSet("wfJumpTargetStep", wfCurrentStep(1))$>

A jump can also include a return step, which tells the workflow where to go if the content is returning from another workflow. The following is an example of a return step that sends the content to the next step in the workflow:

<$wfSet("wfJumpReturnStep", wfCurrentStep(1))$>

A step name variable, step_name>@<workflow_name, is assigned to each step in a workflow. There are two ways to reference a step in a jump:

  • Explicit reference is made to a specific step name, such as Editor@Marketing Brochures.

  • Symbolic reference is made relative to the current step and workflow, such as wfCurrentStep(-1) (previous step) or wfStart (first step in the workflow).

    Tip:

    Use symbolic references rather than explicit step names whenever possible especially when creating a script template.

The entry count variable, entryCount, keeps track of how many times a step has been entered. This is part of the default entry script that is updated each time a step is entered. The following is an example of how an entry count variable is used in a conditional statement:

<$if entryCount = 1$>

The last entry variable, lastEntryTs, keeps track of when the step was last entered. This is part of the default entry script that is updated each time a step is entered. The following is an example of how the last entry variable is used to specify that action should occur if the step has not been acted on within seven days:

<$if parseDate(wfCurrentGet("lastEntryTs")) < dateCurrent(-7)$>

4.5.9 Setting Up Jumps

Before you create jumps in a workflow, you should draw a flowchart and work out all the possible jump scenarios. A recommended method of structuring jumps is to create a main workflow with steps that jump to sub-workflows. See the following example flowchart.

After you have decided what jumps need to occur within a workflow, set up the jumps and then test them. You can create jumps directly in an existing workflow, or you can create script templates for jumps that will be reused in different workflows.

Figure 4-5 Jump Flowchart

Surrounding text describes Figure 4-5 .

4.5.10 Creating a Jump

To create a jump:

  1. Create the workflow that will contain jumps. See "Setting Up a Criteria Workflow" or "Setting Up a Basic Workflow".

  2. Select the workflow on the Workflow Admin: Criteria Tab or the Workflow Admin: Workflows Tab (depending on the type of workflow).

  3. In the Steps pane, click Add, or select the step that will include the jump and click Edit.

    The Add New/Edit Step screen for the workflow type (Criteria or Basic) is displayed.

  4. Click the Events tab.

  5. Click Edit next to the event (entry, update, or exit) that will contain the jump.

    • If a script template does not exist, the Script Properties Screen is displayed. Go to step 0

    • If a script template exists, the Edit Script for StepName Screen is displayed.

    • Select an editing option:

    • To create the script from a blank screen, select Create New.

    • To create the script from a script template, select Use Script Template and then select a template from the option list.

  6. Click OK.

    The Script Properties Screen is displayed.

4.5.10.1 Setting Up Jump Side Effects

Follow these steps to test the side effects.

  1. On the Jumps tab, click Add, or select an existing jump and click Edit.

    The Add/Edit Jump Screen Tabs is displayed.

  2. For a new jump, enter a jump name. The Jump Name cannot be changed after the jump is created. Try to use a meaningful, descriptive name.

  3. If the jump needs to specify a return point, select the Has Return Point check box and select a return point from the option list. The possible options are: Current Step, Next Step, Previous Step.

  4. If the reviewers for this step should not be notified when the jump is entered, select the Do not notify users on entry check box.

  5. If the content item should be released prior to approval, select the Release document from edit state check box.

  6. Enter any custom side effects in the Custom Effects field. See "Jump Examples" for some examples.

  7. If the reviewers will be notified when the jump is entered, click the Message tab and enter the notification message.

  8. Click OK. The Edit Script screen is re-displayed.

4.5.10.2 Setting the Conditional Statement

Follow these steps to set up conditional statements.

  1. Select a metadata field from the Field option list. This is the workflow conditions or metadata field to be evaluated.

  2. Select an operator from the Operator option list. This is a dependent option list that shows only the operators associated with the Field.

  3. Select a value from the Value option list. This is the value associated with the specified metadata field.

  4. Click Add to add the conditional statement to the script.

4.5.10.3 Completing the Jump

Follow these steps to complete the jump.

  1. If the jump needs to specify a target step:

    • To specify a specific step, click Select, and then select the workflow and step name on the Select Target Step screen.The target step name is displayed in the target step area.

    • To select a symbolic step, such as the current step or exit the workflow, select the step from the Target Step option list.

  2. To modify the script that was just created, click the Custom tab, select the Custom Script Expression check box, and edit the code.

    Caution:

    If you clear the Custom Script Expression check box, the expression reverts to its original definition; all modifications will be lost.

4.5.10.4 Testing the Script

Follow these steps to test the script.

  1. Click the Test tab.

  2. Click Select.

    The Content Item View Screen is displayed.

  3. To narrow the content list, select the Use Filter check box, click Define Filter, select the filter criteria, and click OK.

  4. Select a content item to test and click OK. Check in and process a test document so that it is in the workflow and at the step you are adding the jump to, and then select that content item for testing. If the selected content item is not currently in a workflow, you can still use it to test the script, but it will be treated as if it were newly in the workflow.

  5. Click Load Item's Workflow State.

    If the selected content item is in a workflow, the companion file is loaded in the Input Data field.

  6. Click Test Script.

  7. The test results are displayed in the Results field.

    • The value of each parameter in the script is displayed.

    • If any Idoc script errors occur, they are displayed along with the script containing the errors.

  8. To save the script, click OK.

  9. Continue adding jumps as needed to different steps.

4.5.11 Changing a Jump

To change an existing jump:

  1. Select the workflow on the The Workflow Admin Application or the Workflow Admin: Workflows Tab.

  2. In the Steps pane, select the step that includes the jump to be changed.

  3. Click Edit in the Steps pane.

    The Add New/Edit Step screen appears for the workflow type (Criteria or Basic).

  4. Click the Events tab.

  5. To delete a jump, click Clear in the corresponding event pane.

  6. To change a jump, click Edit in the corresponding event pane.

    The Edit Script for StepName Screen is displayed.

  7. Select an editing option:

    • To edit the existing script, select Edit Current.

    • To create a new script, select Create New.

    • To use a script template, select Use Script Template and then select a template from the option list.

    The Script Properties Screen is displayed.

  8. Use the Add, Edit, and Delete buttons in the Jumps pane to change the jump side effects.

  9. Use the Field, Operator, Value fields and Add and Update buttons in the Script Clauses pane to change the conditional statements for the jumps.

  10. Use the Target Step option list to change the target step for the jump.

  11. To change the automatically generated script, click the Custom tab, select the Custom Script Expression check box, and edit the code.

    Caution:

    If you clear the Custom Script Expression check box, the expression reverts to its original definition; all modifications will be lost.
  12. Test the script before saving it. See step 0 of Creating a Jump.

  13. Click OK to save the changes.

4.5.12 Jump Examples

The following examples describe how to set up different types of jumps.

4.5.12.1 Jump Example 1: Metadata Criteria Jump

Perhaps you have a Criteria workflow called Marketing Brochures that is defined with the Marketing security group and the MktBrochure content type. However, any brochures submitted by a graphic artist do not need to go through the first step, which is graphics department approval. You would use the Edit Script screen to create the following entry event script for the first step.

<$if dDocAuthor like "bjones" or dDocAuthor like "sjames"$>
  <$wfSet("wfJumpName", "BypassGraphics")$>
  <$wfSet("wfJumpTargetStep", wfCurrentStep(1))$>
  <$wfSet("wfJumpEntryNotifyOff", "0")$>
<$endif$>

To change the automatically generated conditional statement from and to or, you would need to edit the script on the Custom tab of the Edit Script screen.

4.5.12.2 Jump Example 2: Time-dependent Jump

Suppose you want to limit the review period to one week. If the revision has not been approved or rejected, you want to notify the reviewers and process the revision through a sub-workflow called ApprovalPeriodExpired. You would use the Edit Script screen to create the following update event script:

<$if parseDate(wfCurrentGet("lastEntryTs")) < dateCurrent(-7)$>
  <$wfSet("wfJumpName", "LateApproval")$>
  <$wfSet("wfJumpTargetStep",
    "NotifyAuthor@ApprovalPeriodExpired")$> 
  <$wfSet("wfJumpMessage", "The review period for content item
    <$eval(<$dDocTitle$>)$> has expired.")$>
  <$wfSet("wfJumpReturnStep", wfCurrentStep(0))$>
  <$wfSet("wfJumpEntryNotifyOff", "0")$>
<$endif$>

4.5.12.3 Jump Errors

There are two possible responses to a jump error:

  • An event script that causes an error in execution is treated as if it had never been evaluated. However, the default entry script that keeps track of the entry count and last entry is still evaluated.

  • A jump to an invalid step or a step in an inactive workflow results in an error, and the revision is treated as if it has completed the last step of the workflow.

4.6 Workflow And Script Templates

Workflow templates are a quick way to re-use workflows that you've already created. Each workflow template is an outline for a Basic, Criteria, or sub-workflow that is stored in the Workflow Admin tool. A workflow template is not tied to a security group, and it cannot include step event scripts.

This chapter contains the following topics:

Important:

When you use a workflow template, you must change the reviewers if they are different from those defined in the selected template.

4.6.1 Creating Templates and Scripts

Script templates can be used to store step event scripts, but they work differently than workflow templates. See "Creating a Script Template" for more information.

The procedure to create a template uses many of the same steps used in setting up a workflow. This section provides an overview of the process. For details see "Setting Up a Criteria Workflow" or "Setting Up a Basic Workflow".

4.6.2 Creating a Workflow Template

To create a workflow template:

  1. Display the Workflow Admin: Templates Tab.

  2. Click Add.

    The Add/Edit Template Screen is displayed.

  3. Enter a template name in the Template Name field. The Template Name cannot be changed after the template is created.

  4. Enter a detailed description in the Description field.

  5. Specify whether to permit the original author to edit the existing revision or create a new revision if the content item is rejected by checking the appropriate box.

  6. Add a step by clicking Add.

  7. Enter an appropriate Name and Description for the step.

  8. Specify the authority level of the users for the step: Users can review the current revision, Users can review and edit (replace) the current revision or Users can review the current revision or create new revision.

  9. Click OK.

  10. Select the type of users to be added the step. More than one type of user can be defined for a step.

  11. Click OK.

  12. Click the Exit Conditions tab.

  13. Specify how many reviewers must approve the revision before it passes to the next step.

  14. Specify additional exit conditions if needed.

  15. If the workflow requires conditional steps or special processing, click the Events tab and add the appropriate scripts.

  16. Click OK.

4.6.3 Changing a Workflow Template

To change an existing workflow template:

  1. Display the Workflow Admin: Templates Tab.

  2. Select the workflow template you want to change.

  3. Click Edit.

    The Add/Edit Template Screen is displayed.

  4. Use the Add, Edit, and Delete buttons in the Steps pane to change the steps.

  5. Use the Add Alias, Add User, Add Token, and Delete buttons on the Users tab to add or delete reviewers for the selected step.

  6. On the Exit Conditions tab, change the number of reviewers required or the additional exit conditions as necessary.

  7. On the Events tab, add, change, or delete jumps as necessary. See "Setting Up Jumps" for more information.

  8. Click OK.

4.6.4 Deleting a Workflow Template

To delete a workflow template:

  1. Display the Workflow Admin: Templates Tab.

  2. Select the workflow template you want to delete.

  3. Click Delete.

    A confirmation screen is displayed.

  4. Click Yes.

4.6.5 Creating a Script Template

Script templates are a quick way to re-use step event scripts that you've already created. A script template is used as a starting point for creating event scripts. Each script template is a piece of Idoc Script stored in the Workflow Admin tool.

Important:

Script templates should use symbolic step names rather than explicit references. See "Jump Variables and Steps" for more information.

Follow these steps to create a script template:

  1. In The Workflow Admin Application, select Script Templates from the Options menu.

  2. Click Add.

    The Add/Edit Script Screen is displayed.

  3. Enter a script name in the Script Name field. The Script Name cannot be changed after the script template is created.

  4. Enter a detailed description in the Description field.

4.6.5.1 Setting Up Jump Side Effects

  1. On the Jumps tab, click Add.

  2. Enter a jump name. The name cannot be changed after the jump is created.

  3. If the jump needs to specify a return point, select the Has Return Point check box and select a return point from the option list.

  4. If users should not be notified when the jump is entered, select the Do not notify users on entry check box.

  5. If the content item should be released prior to approval, select the Release document from edit state check box.

  6. Enter any custom side effects in the Custom Effects field.

  7. If users will be notified when the jump is entered, click the Message tab and enter the notification message.

  8. Click OK.

4.6.5.2 Setting Up Script Template Conditional Statements

  1. Select a metadata field from the Field option list.

  2. Select an operator from the Operator option list.

  3. Select a value from the Value option list.

  4. Click Add to add the conditional statement to the script.

4.6.5.3 Testing the Script

  1. Click the Test tab.

  2. Click Select.

    The Content Item View Screen is displayed.

  3. To narrow the content list, select the Use Filter check box, click Define Filter, select the filter criteria, and click OK.

  4. Select a content item to test and click OK. If the selected content item is not currently in a workflow, you can still use it to test the script but it will be treated as if it were newly in the workflow.

  5. Click Select Workflow.

    The Select Workflow Step Screen is displayed.

  6. Select a workflow in the Workflows pane, select a step in the Steps pane, and click OK. Select a workflow step that is similar to the ones for which the script template will be used.

  7. Click Load Item's Workflow State.

    If the selected content item is in a workflow, the companion file is loaded in the Input Data field.

  8. Click Test Script.

  9. The test results are displayed in the Results field.

    • The value of each parameter in the script is displayed.

    • If any Idoc script errors occur, they are displayed along with the script containing the errors.

  10. To save the script template, click OK.

4.6.5.4 Changing a Script Template

To change an existing script template:

  1. In The Workflow Admin Application, select Script Templates from the Options menu.

    The Workflow Scripts Screen is displayed.

  2. Select the script template you want to change.

  3. Click Edit.

    The Add/Edit Script Screen is displayed.

  4. Use the Add, Edit, and Delete buttons in the Jumps pane to change the jumps.

  5. Use the Field, Operator, Value fields and Add and Update buttons in the Script Clauses pane to change the conditional statements for the jumps.

  6. Use the Target Step option list to change the target step for the jump.

  7. To modify the automatically generated script, click the Custom tab, select the Custom Script Expression check box, and edit the text.

    Caution:

    If you clear the Custom Script Expression check box, the expression reverts to its original definition; all modifications will be lost.
  8. Test the script before saving it. See step 1 of Creating a Jump.

  9. Click OK to save the changes.

4.6.5.5 Deleting a Script Template

To change an existing script template:

  1. In The Workflow Admin Application, select Script Templates from the Options menu.

    The Workflow Scripts Screen is displayed.

  2. Select the script template you want to delete.

  3. Click Delete.

    A confirmation screen is displayed.

  4. Click Yes.

4.7 Workflow Scenarios

The following workflow scenario describe the planning process and the types of actions required to accomplish specific workflow tasks. It includes the following workflow examples:

4.7.1 Scenario 1: Criteria Workflow

Your Marketing department wants to have all marketing brochures approved by at least one of the three graphic artists, the editor, and all of the marketing supervisors. The graphic artists and editor should be able to edit the content, but the supervisors should not have editing privileges.

To set up the workflow for this example, you would:

  • Define a security group called Marketing, and make sure that the graphic artists and the editor have Write permission, and the marketing supervisors have Read permission to the security group.

  • Define a content type called MktBrochure.

  • Define a workflow called Marketing Brochures, with the security group set to Marketing and criteria set to Type = MktBrochure.

  • Define the first step, called Graphic Artist, as a Reviewer/Contributor step with approval required from at least 1 reviewer. Because the graphics department is very stable, you can assign the user logins of the three graphic artists to the step.

  • Define the second step, called Editor, as a Reviewer/Contributor step. Assign the editor's user login to the step.

  • Define the third step, called Marketing Team, as a Reviewer step with approval required from all reviewers. The management structure changes frequently, so set up an alias called MktTeam and assign it to this step.

  • All marketing brochures must be checked into the Marketing security group with a Type of MktBrochure, so it is a good idea to instruct all possible contributors of marketing brochures about how to check them in.

  • For the approval process to work correctly, the MktTeam alias must be kept up-to-date.

4.7.2 Scenario 2: Tokens

After you created the Marketing Brochures workflow in Scenario 1, the Marketing department requested that all marketing brochures be returned to the original author for final review before they are released. The original author should not have editing privileges.

To set up the workflow for this example, you would:

  • Create a token called Author and define the user as dDocAuthor.

  • Define a fourth step in the workflow, called Original Author, as a Reviewer step. Assign the Author token to the step.

4.7.3 Scenario 3: Jump Based on Metadata

The Marketing Brochures workflow you created in Scenarios 1 and 3 is working smoothly, but now the Marketing department would like to automatically notify the various sales reps when a new brochure is released for one of their product lines.

To set up the workflow for this example, you would:

  • Define a required custom metadata field called Product, and create an option list of the products.

  • Set up an alias for each product, and assign the appropriate sales reps to each alias. Note that each user can be assigned to more than one alias.

  • Define a fifth step in the workflow, called Notify Sales, as a Reviewer step with approval required from zero (0) reviewers.

  • Define a sub-workflow for each product that contains one Reviewer step with approval required from zero (0) reviewers. Assign the corresponding product alias to the step.

  • Define an entry script in the Notify Sales step that jumps to the sub-workflow that matches the product.

  • For the notification process to work correctly, the product option list and aliases must be kept up-to-date.

4.7.4 Scenario 4: Time-Dependent Jump

The Marketing department is having trouble getting marketing brochures approved in a timely manner. They would like to change the Marketing Brochures workflow to automatically move content to the next step if it hasn't been approved or rejected by the graphics department, supervisors, or original author within 7 days. The editor is allowed a little more time—they get 10 days before the content goes to the next step.

To set up the workflow for this example, you would:

  • Define a script template called AutoApprove, with a target step that goes to the next step in the workflow if the last entry was 7 days ago.

  • Add an update jump to the Graphic Artist, Marketing Team, and Original Author steps. Use the AutoApprove script template to create the jump.

  • Add an update jump to the Editor step, using the AutoApprove script template. Edit the script so that the jump occurs at 10 days rather than 7 days.

4.8 Workflow Tips and Tricks

This section describes workflow tips and tricks. It covers the following topics:

In addition to this functionality, additional customizations are available through Consulting Services. See "Other Customizations", for details.

4.8.1 Acquiring a Digital Signature

It is sometimes necessary to re-authenticate a user during a workflow. This serves as a digital signature for the users during that particular step of the workflow. To enable this functionality, first determine which workflow steps require authentication before approval. Then do the following:

  1. Add the following line to the IntradocDir/config/config.cfg file:

    <workflow step name>:isRepromptLogin=true

    If multiple workflow steps require validation, add those steps on separate lines.

  2. Restart the Content Server.

  3. Set up and enable the workflow, making sure to use the step name designated in the configuration entry for the step where validation is required.

When the workflow is initiated, the users at the workflow step designated with the isRepromptLogin configuration variable are prompted to login in before they can approve the content at the workflow step.

In the following example, validation is required at the steps named VIPApproval and CEOsignoff. The following entries are added to the config.cfg file:

VIPApproval:isRepromptLogin=true
CEOsignoff:isRepromptLogin=true

The Content Server is restarted and a workflow is set up and enabled with steps named VIPApproval and CEOsignoff. Multiple users are assigned to the VIPApproval step, and only one user (the CEO of the company) is assigned to the CEOsignoff step.

Before the users at those steps can approve the workflow item, they must login again to the content server.

This functionality is available in Content Server 7.5 and later versions.

4.8.2 Setting Up Parallel Workflows

It is sometimes desirable to have two distinct groups of users be able to review content items in workflow at the same time and to have a specified number of users from each group approve the content before it proceeds in the workflow.

When using Content Server, either all users or a specified number of users must approve the content before it continues. Usually the workflow does not differentiate between sources of approval. Consequently, all members of one group may approve content while none of another group would approve it, and the content would still advance through the workflow. The following code provides an example of how approval process discrimination can be added.

This code allows step users to be set into groups. At each approval, the script checks for the group to which a user belongs. A user may belong to multiple groups; if the approving user is in a group, the counter for that group is incremented by one.

Extra exit conditions hold the content in the step until the extra conditions are met.

Add the following code in the entry portion of the step:

<$wfSet("set1", "0")$>
<$wfSet("set2", "0")$>
<$group1 = "user1, user2, user3,"$>
<$wfSet("group1", group1)$>
<$group2 = "user8, user9, user10,"$>
<$wfSet("group2", group2)$>

Add the following code in the update portion of the step:

<$if wfAction like "APPROVE"$>
<$if strIndexOf(wfGet("group1"), dUser) >=0$>
<$set1 = toInteger(wfGet("set1"))+1$>
<$wfSet("set1", set1)$>
<$endif$>
<$if strIndexOf(wfGet("group2"), dUser)>=0$>
<$set2 = toInteger(wfGet("set2"))+1$>
<$wfSet("set2", set2)$>
<$endif$>
<$endif$>

Add the following code in the extra exit conditions portion of the step (where n is the number of required approvers from group 1 and r is the number of required approvers from group 2):

toInteger(wfGet("set1")) >= n
toInteger(wfGet("set2")) >= r

By checking the approving user during each approve action, this workflow code increments the counter of the group to which the user belongs. The extra exit conditions hold the content item in the step until the minimum number of users in each group have approved it. If more than the minimum number of required approves for each group are executed, the approve actions are still logged but the content item does not proceed.

Reject actions are still absolute. A rejection from any named user still executes normal workflow reject behavior.

4.8.3 Adding Ad Hoc Step Users

Users can be added to workflow steps without utilizing metadata fields that are normally accessed by tokens. For example, a content item is traveling (and being edited) in workflow; each edit lists the person editing the content as the dDocAuthor. In order to send the item to the original author at the end of the workflow cycle, a special token must be created:

<$wfAddUser(wfGet("originalContributor"), wfGet("type”))$>

Add the following code to the entry event of the first step in the workflow to restore the original author:

<$originalContributor=dDocAuthor$>
<$wfSet("originalContributor",originalContributor)$>
<$type="user"$> 
<$wfSet("type",type)$>

The event script uses wfSet() to put custom variables and values into the companion file at a point prior to the token call. The token then uses wfGet() to pull out those values and set the step user.

This technique can be used to obtain and store any standard or custom Idoc variable that holds valid user names or aliases. The Idoc variable can contain a comma-separated list of user names or aliases. If user names are being stored, the <$type$> variable must be set to user (for example, <$type=”user”$>. If alias names are being stored, the <$type$> variable must be set to alias (for example, <$type=”alias”$>.

When placed in the entry event of a workflow step with the token set as the step user, the entry event code processes the information. It stores the user name (or alias) which is then called by the token and is set as a step user (or users, if a list was specified). Adding multiple or conditional code blocks and tokens (as shown previously) to your step entry events and step user definitions allows true ad hoc workflow routing.

4.8.4 Customizing Criteria Workflow Emails

Emails are triggered by criteria workflow at three points in the process:

  • On entry to a step.

  • On receipt of a reject reasons form.

  • On execution of the wfNotify Idoc script function.

It is possible to customize the email message, the email subject, and the template used for emails sent during criteria workflows. This section describes the processes for customizing the email aspects of criteria workflows.

4.8.4.1 Customizing Email Templates

The two most commonly used templates used to generate email messages sent to recipients involved in a workflow are reviewer_mail.htm and reject_mail.htm. These are stored in IdcHomeDir/resources/core/templates.

These templates can be modified like any other template. Email template modification provides the greatest flexibility and opportunity for customizing workflow emails. Although this kind of modification is relatively straightforward, it still requires careful component development. Modifying the subject and the message in the email is often the most important part of the message, and thus is often the most modified.

Custom workflow email templates that are based on the standard templates can also be created. Custom templates can be called as needed by adding them as the optional third parameter to the wfNotify function, as in these examples:

<$wfNotify(userName, "user", templateName)$>
<$wfNotify(aliasName, "alias", templateName)$>

If an alternate template is not specified, the system default template is used.

See the discussion of wfNotify in the Oracle Fusion Middleware Idoc Script Reference Guide for more details.

4.8.4.2 Customizing the Subject or Message Line

Criteria workflow email subject and message lines can be customized for your application.The email subject line appears in the email; the message line appears in the email body with other information about the workflow email (workflow name, step, and content item).

The message line defaults to one of two messages, depending on whether the step is notification-only (that is, if it has zero required reviewers).

Subject lines and message lines can be customized in two ways:

  • The core string resource file can be modified according to standard component architecture.

  • For simple customizations, the wfMailSubject (for email subjects) or wfMessage (for message lines) Idoc Script variable can be declared in a criteria workflow step event script or stored in the companion file.

4.8.4.2.1 Modifying Strings

The string definitions are as follows (variable 1 is the content item title and variable 2 is the name of the workflow step):

<@wwWfIsNotifyOnly=Workflow notification for content item '{1}' is in step '{2}'.@>

<@wwWfReadyForStep=Content item '{1}' is ready for workflow step '{2}'.@> 

<@wwWfRejected=Content item '{1}' has been rejected.@> 

These string definitions are usually called with the Idoc Script <$lc()$> localization function and they can be aliased in a component resource file. See the <@dynamichtml wf_approve_mail_subject@> include definition in the std_page.htm file for an example of email subject line string includes.

4.8.4.2.2 Changing Idoc Variables

For simple email or subject line changes, Idoc Script rather than a component can be used. The wfMailSubject configuration variable or the wfMessage configuration variable can be placed in step event script. The value of these variables can also accept Idoc Script, as in this example:

<$wfMailSubject=”My custom subject text for content with <$dDocTitle$> title”$>

No eval() function is required for the Idoc Script variables to evaluate.

If wfMailSubject or wfMessage is placed in the entry event of a workflow step, the email messages triggered by content entering the step receives the customized subject or message line. These variables can also be declared prior to a wfNotify() function and the email then generated by that function receives the customization.

4.8.5 Workflow Escalation

This example requires familiarity with tokens and coding.

Workflow escalation (that is, dynamically routing workflow content to different people than listed users) is a common workflow requirement. While this is easily accomplished with jumps and parsing of some criteria (for example, date, action, metadata) there is often some initial confusion or hesitation as to where or to whom the content should go.

The issue is further complicated when the solution is to add a larger number of step users and to require only a subset of those users to approve the content before it can move on. This workflow will still generate and send out emails and appear in the workflow queue of non-approving users, users out of the office, and others who are there "just in case" some primary reviewer is not available.

4.8.5.1 Setting Up a Workflow Escalation

This solution incorporates two custom user metadata fields, a token, and workflow step entry and update event code.

  1. Create a user metadata field with the following elements:

    • name: OutOfOffice

    • type: text

    • option list: yes

    • option list type: select list validated

    • option list values:<blank>, false, and true

  2. Create another user metadata field with the following elements:

    • name: OutOfOfficeBackup

    • type: Long Text

    The OutOfOffice field is a flag that the user will set as TRUE when s/he is out of the office. The user sets this flag by selecting the TRUE option from the choice list and updating her/his user profile by clicking the update button.

    The OutOfOfficeBackup field contains the user name(s) of those users who can fill in as proxies for the out-of-office user. This field will optimally contain a single user name, formatted exactly as it appears in the User Admin applet.

    When the following workflow step event code finds that one of the listed users is "out of the office" it switches that user's name for the listed proxy (as designated by the value in the OutOfOfficeBackup field). The workflow step then restarts with only the users who had not yet approved the content and any designated proxies.

    A token pulls the list of users out of the companion file and sets them as step users. Special workflow messages are sent to designated proxies while the content was sitting in the update step event.

  3. Create a workflow Token

    • name: DynamicStepUsers

    • Token Code:

      <$if wfGet("dsu")$> 
        <$wfAddUser(wfGet("dsu"), "user")$> 
      <$else$>
        <$wfAddUser("sysadmin", "user")$> 
      <$endif$> 
        <$if wfGet("dsa")$> 
           <$wfAddUser(wfGet("dsa"), "alias")$>
      <$endif$> 
      

    The token pulls a value for the custom variable dsu and dsa out of the companion file. If no value is found for dsu then the sysadmin user is added as a precaution. The initial values for dsu and dsa are listed in the entry event of the step. Users only: If you need to assign users to the step(s), add the first contributor to the first step and the next step must include the first user plus the next user, user two.

  4. Paste the following code into the entry event of your workflow step. Note that comments are included through the entry code; remove the comments before inserting into your step:

    <$restartFlag=wfGet("restartStep")$>
    

    See if we got here due to a restart for new backup users. If so, suppress notifications to old users and notify only new ones

    <$if restartFlag$>
    <$if toInteger(wfGet("restartStep"))>=1$>
      <$wfSet("wfJumpEntryNotifyOff", "1")$>
      <$oooUsers=wfGet("outOfOfficeUsers")$>
      <$if strIndexOf(oooUsers,",")>=1$>
    

    Check for multiple out of office users

      <$wfMessage=eval("The Following Users are out of the office: <$oooUsers$>
      \nYou are the designated backup for one of them.\n
      The content item <$dDocName$> is in the workflow step <$dwfStepName$> awaiting your   review")$>
    <$else$>
      <$wfMessage=eval("The Following User is out of the office: <$oooUsers$>
      \nYou are the designated backup for this user.\n
      The content item <$dDocName$> is in the workflow step <$dwfStepName$> awaiting your   review")$>
    <$endif$>
    <$rsMakeFromString("ooou",oooUsers)$>
    <$loop ooou$>
      <$userBackupName=row&"_Bkup"$>
      <$wfNotify(wfGet(userBackupName),"user")$>
    <$endloop$>
    <$wfSet("restartStep","0")$>
    <$endif$>
        <$else$>
    <$wfSet("restartStep","0")$>
      <$endif$>
    

    Set your step users here. Multiple users should be comma-separated, user names should be in quotes, metadata field references are unquoted. This example proceeds, using user names rather than aliases. Slight code re-working is required if using aliases.

    <$dynamicStepUsers= <LIST USER NAMES IN QUOTES HERE>$>
    
    <$if strIndexOf(dynamicStepUsers,",")>=1$>
    

    If there are multiple users specified check to see if any of the MULTIPLE users are out of the office

    <$rsMakeFromString("multiDynamicUsers",dynamicStepUsers)$>
    <$loop multiDynamicUsers$>
      <$if strEquals(getValueForSpecifiedUser(row,"uOutOfOffice"),"true")$>
    

    If user is out of office, get their backup

      <$backup=getValueForSpecifiedUser(row,"uOutOfOfficeBackup")$>
    

    Replace out-of-office user in users list with their backup

      <$dynamicStepUsers=strReplace(dynamicStepUsers,row,backup)$>
      <$endif$>
      <$endloop$>
       <$else$>
    

    Check to see if the SINGLE user is out of the office

      <$if strEquals(getValueForSpecifiedUser(dynamicStepUsers,"uOutOfOffice"),"true")$>
    

    If user is out of office, get their backup

    <$dynamicStepUsers=getValueForSpecifiedUser(dynamicStepUsers,"uOutOfOfficeBackup")$>
      <$endif$>
    <$endif$>
    <$wfSet("dsu",dynamicStepUsers)$>
    

    Set the dsu variable into the companion file with listed and backup users

  5. Paste the following code into the update event of your workflow step, removing comment lines before doing so:

    <$remainingUsers=wfGet("wfUserQueue")$>
    

    Get users who have yet to approve

    <$rsMakeFromString("ru", remainingUsers)$>
    <$loop ru$>
    <$if strEquals(getValueForSpecifiedUser(row,"uOutOfOffice"),"true")$>
    

    Check the remaining users to see if they are out of the office

    <$if getBackup$>
    

    Create list of users requiring backup substitutes

      <$getBackup=row &","&getBackup$>
    <$else$>
      <$getBackup=row$>
    <$endif$>
    <$endif$>
    <$endloop$>
    <$if getBackup or strLength(getBackup)>0 $>
    

    If one of the users is listed as out of office then rewrite the user list and restart the step

    <$wfSet("outOfOfficeUsers",getBackup)$>
    <$rsMakeFromString("needBkup", getBackup)$>
    <$loop needBkup$>
    <$bkupUser=getValueForSpecifiedUser(row,"uOutOfOfficeBackup")$>
    <$newRemainingUsersList=strReplace(remainingUsers,row,bkupUser)$>
    <$wfSet(row&"_Bkup",bkupUser)$>
    <$endloop$>
    <$wfSet("dsu",newRemainingUsersList)$>
    <$getBackup=""$>
      
    <$wfSet("wfJumpTargetStep", wfCurrentStep(0))$>
    <$wfSet("restartStep","1")$>                             
    <$endif$>
    

4.8.6 Other Customizations

Many workflow customizations are available through Consulting Services. This section briefly describes two of those customizations. Please consider engaging Oracle Consulting Services for a thorough evaluation of the impact associated with the replication of workflow examples.

The following customizations are discussed in this section:

4.8.6.1 Setting Approval by Non-Reviewers

It is sometimes necessary to have a person approve content in a workflow step even if that individual is not part of the actual workflow. For example, it may be useful to have a one-time outside opinion on a document in a particular stage in a workflow or be useful to designate a one-time reviewer because another reviewer is out of the office. This allows the individual to approve content but they do not get normal workflow notifications and do not see the content items in their workflow queues.

Users with designated roles or who are members of designated aliases can approve content on this basis. These designated users see a Bypass Approve link in the workflow actions box for each item in a workflow to which they have normal security access. Performing a Bypass Approve approves the content item in the step in which it currently resides. Defined step exit conditions are still evaluated and still apply. The approval is logged in the Workflow History database table and in the WorkflowActionHistory ResultSet of the companion file.

A designated approver is not a regular workflow step approver and thus does not receive automatic workflow notifications. Because of this, access to a content item in a workflow where the approver wants to perform a Bypass Approve action must be intentional. The designated approver must access the Active Workflows menu, then select the workflow name and select an action.

The designated approver component aliases core resources. Therefore if other components are running or are planned, this should be taken into account. In some cases, component resources may be combined to include all desired functionality or can be renamed and re-referenced to keep all components working correctly (but separately).

4.8.6.1.1 Scenarios

For the following scenarios, assume that User A has a role or alias that grants designated approver status and that a sample workflow named MyWF has two steps.

  • Scenario 1: User A is listed as an approver for step 1 in MyWF but not in step 2. Therefore, no Bypass Approve link appears for Step 1. User A received default workflow action capabilities and notifications. The Bypass Approve link for step 2 appears under the Workflow Actions menu if User A accesses the Content in workflow 'MyWF' page when the content item is in step 2.

  • Scenario 2: User A is not listed as an approver in MyWF. The Bypass Approve link appears in the action menu on the Content in workflow 'MyWF' page for all steps and for all content to which User A has at least Read permission in its Security group.

  • Scenario 3: User A is not listed as an approver for Step 1 in MyWF. Step 1 requires two approvals from reviewers before it will move to step 2. The Bypass Approve link appears for User A. Clicking Bypass Approve registers an approval and fulfills one of the two required approvals for the step to continue in the workflow.

4.8.6.2 Automatic Replication of Workflow Items

Content items are often processed (in one form or another) before they are 'released'. A released content item is indexed and can then be included in search results, archives, and in other processes and applications.

It is sometimes useful to release a content item prior to its completion in the workflow. For example, a content item must be in a released state in order to be replicated (and perhaps later used in disaster recovery). Items not released (such as items in workflows) are not used by the replicator.

It is possible to designate workflow items as released while still in workflow. Normal workflow actions, such as updating, checking out, and checking in are still available. However, these items will be indexed and show up in search results, can be used in replication and archiving, and in any other processes or applications.

Important:

There are several elements to consider before replicating workflow items. This section describes the process but does not go into detail; contact Consulting Services before setting up replication of workflow items.
4.8.6.2.1 Potential Conflicts

There are several points to be aware of before setting up automatic replication:

  • Loss of data integrity: A premature release of content, whether intentional or otherwise, can have unforeseen effects on business process management, content accessibility, and information integrity. Potential ramifications should be thoroughly considered before the release of items still in workflow is considered.

  • Non-capture of workflow information: Workflows are a combination of process and content. While it is possible to release content and make it available for replication and other processes, it is not possible (without customization and assistance from Consulting Services) to capture and replicate workflow state information.

    If content in a workflow on a source instance is replicated and released on a target instance without passing through a workflow on that instance, the recovery process will involve manual effort to re-set the content's workflow state.

    In most cases, cloning of workflow information is not necessary because recovery to a prior workflow state is required only during true disaster recovery. In all other cases, content items will replicate as normal after exiting a workflow and will supersede versions or revisions replicated during workflow.

  • Imported content items do not enter workflow: Content items replicated while in a workflow on a source instance will not enter a workflow on the target instance without additional customization and assistance from Consulting Services. Replicated content items will be checked in to the target instance and released.

  • Restoration of replicated workflow items requires manual intervention: Some workflow information can be captured as metadata for use in a manual restoration of the workflow. Only a check-in action triggers a content item's entry into workflow; therefore, the restoration of an item back into a workflow requires that a new revision be created.

    This introduces a discrepancy between the number of revisions on the source and the target instances. In order to recover the content items on the target to a state as close as possible to their previous state on the source, a discrepancy between the two instances is intentionally and unavoidably introduced.

4.8.6.2.2 Scenarios

For content item 1, not released while in workflow, the following is true:

  • The content item moves through workflow in a non-released state.

  • The content item is not a candidate for replication while in workflow.

  • The content item is available only to named workflow step reviewers and administrators.

  • When the content item completes the workflow, it is released to the Content Server, indexed, and is now a candidate for replication.

For content item 2, released while in workflow, the following is true:

  • The content item moves through workflow and is released as specified. After an item is released, it cannot be 'unreleased'. New revisions of a content item created during workflow are not released unless specified.

  • Content items released while in workflow will display in search results and can be viewed by users with the appropriate security access.

  • Users cannot edit, check out, check in, or update a released item that is in workflow unless they are designated users for the step in which the item is located and that step allows the attempted action.

  • A content item released while in workflow is a candidate for automatic replication. The Replicator treats the item as if it is not in workflow.

  • Content items completing workflow are replicated in the normal fashion and supersede any pre-existing content item versions replicated during workflow.

Contact Consulting Services for details about and the implications of the release of content items in workflow for replication or other purposes.

4.8.7 Triggering Criteria Workflows from Folders

It is sometimes necessary for documents in a particular folder to go through a criteria workflow. However, when you create a criteria workflow based on a folder, the criteria option of folder is not listed in the field list. The field list in criteria workflows only lists fields with a type of text or long text. Because Folder (xCollectionID) is an integer field, it is not an option.

Although the folder field cannot be selected on the Edit Criteria form, it can be defined as a criteria in Events. In the Entry Event of the first step, a criteria can be set up to check for the appropriate folder number (xCollectionID). If it does not fulfill the criteria, the item can be exited from the workflow.

The following general steps detail how to set up such a workflow:

  1. Start a new criteria workflow and choose the Security Group that the workflow will use.

  2. In the Criteria Definition section, define a global criteria to monitor all of the documents that enter the system. This can be something as simple as the following:

    Field: ContentID
    Operator: Matches
    Value: *
    

    This checks every content item matching the Security Group coming into the system. It may be preferable to only monitor items coming in through folders. In that scenario, an extra metadata field can be set which is defaulted on all folders for which the criteria is based.

    If multiple workflows are in place, it may be best to filter all content through this workflow and jump to sub-workflows through multiple criteria settings in the first step of this workflow.

  3. Add the first step to the workflow.

  4. In the Events tab, click Edit from the Entry Event.

  5. On the Jumps tab, click Add.

  6. Give the jump a meaningful name (for example, Folder Criteria) and click OK.

  7. For the jump criteria, enter the following:

    Field: Folder
    Operator: Not Equals
    Value: Folder ID on which the workflow should be based
    

    When done, click Add.

  8. For the Target Step, select Exit to Parent Step and change both of the 0 parameters to 10 (for example, @wfExit(10,10). This forces documents that are not in the folder out of the workflow.

  9. Click OK on the Entry Event and click OK on the Add New Step dialog.

  10. Add the necessary jumps, steps, and events for the rest of the workflow and enable it.

4.8.8 Searching Within a Workflow Step

When executing the GET_SEARCH_RESULTS service within a workflow step, you may not get the expected results. When executing services in a workflow event, you can experience data corruption because the workflow's data binder is being used by the service.

A solution for this is to temporarily set the security group value into a temporary variable. Then clear the current security group value, make the call for the search results, then reset the security group back again. This should return the results being sought.

4.8.9 Suppressing Workflow Notifications

When a workflow step requires multiple approvers, a user who has already approved the document may be re-notified during a timed workflow update cycle. In order to prevent additional notifications, use the wfSetIsNotifyingUsers workflow function. Used in a workflow step in the script section of the workflow, it sets an internal flag to determine if workflow notifications will be sent out during the current document action (check in, approve, update, and so on). The suppression is applied to both email and updates to the workflow in the queue.

When used in combination with wfIsFinishedDocConversion, this function can suppress notification until conversion is finished. It does not prevent documents from advancing out of the auto-contributor step but it does stop updates of the workflow in queue and notification emails.

These notifications are not lost. If the wfSetIsNotifyingUsers function is not used in a future workflow event to suppress notifications (updates to workflow in queue and workflow mail) then all users participating in the current step are notified.

Additional functions which can be used in the script section are the following:

  • wfIsFinishedDocConversion, which returns a result indicating if the document will not be in GENWWW after the current document action ends.

  • wfIsNotifyingUsers, which returns a result indicating if the workflow is currently suppressing all workflow notification for this particular workflow event.

See the Oracle Fusion Middleware Idoc Script Reference Guide for usage details for all of these functions.

4.9 Workflow Troubleshooting

This section provides solutions to several common workflow issues.

4.9.1 Workflow Item Stuck in EDIT or GENWWW Status

Symptom

A content item in a workflow is in EDIT or GENWWW status, and no reviewers were notified by e-mail that action is required.

Problem

Inbound Refinery failed to convert the file properly.

Recommendation

  1. View the content item's status in Repository Manager or the Content Items for Workflow page (accessed from Content Manager, then Active Workflows and then <Workflow_Name>). For more details on the conversion failure, display the Content Information page.

  2. Determine why the conversion failed:

    • If the problem was with Inbound Refinery or a conversion add-on product:

      1. Correct the problem so that the file will convert properly.

      2. Resubmit the file for conversion from Repository Manager or Content Information page. The content item will continue through the workflow.

    • If the problem was with a file in a criteria workflow and the content item is the only item in the workflow:

      1. Save a copy of the native file.

      2. Disable the workflow to release the content item.

      3. Delete the released revision using Repository Manager or the Content Information page.

      4. Correct the problem so that the file will convert properly.

      5. Check in the content item again so that it goes through the entire workflow process.

    • If the problem was with a file in a criteria workflow and there are multiple content items in the workflow:

      1. Save a copy of the native file.

      2. Delete the "stuck" revision using Repository Manager. (You could disable the workflow, but all content items in the workflow would be released.)

      3. Correct the problem so that the file will convert properly.

      4. Check in the content item again so that it goes through the entire workflow process

    • If the problem was with a file in a basic workflow and the content item is the only item in the workflow:

      1. Save a copy of the native file.

      2. Cancel the workflow to delete the revision from the system.

      3. Correct the problem so that the file will convert properly.

      4. Contribute the content item again to the Basic workflow so that it goes through the entire workflow process.

    • If the problem was with a file in a basic workflow and there are multiple content items in the workflow:

      1. Save a copy of the native file.

      2. Delete the "stuck" revision using Repository Manager. (You could cancel the workflow, but all content items in the workflow would be deleted from the system.)

      3. Correct the problem so that the file will convert properly.

      4. Contribute the content item again to the Basic workflow so that it goes through the entire workflow process

4.9.2 Workflow Item Stuck in REVIEW Status

Symptom

A content item in a workflow is in REVIEW status, and the minimum number of reviewers have approved it, but the revision is not moving to the next step.

Problem

The content item does not meet the exit criteria of the workflow.

Recommendation

  1. Check the exit condition definition in the workflow step to see why the document does not meet the exit criteria.

  2. Determine if the file is finished interacting with an external process. Resolve any problems with the external process to see if the exit condition can be met.

  3. If there is an error in the exit condition and/or external processing, you can check out the document and check it back in with the correct metadata to meet the exit condition.

4.9.3 Workflow Item Entered in Wrong Workflow

Symptom

A content item entered the wrong criteria workflow.

Problem

Two or more criteria workflows have the same criteria defined. The content item matched this criteria, so it entered the first matching workflow in the workflow list.

Recommendation

Redefine the criteria so that each workflow has a unique combination of the security group and metadata field value. If necessary, use jumps and sub-workflows to define additional criteria within the main workflow.