Jump Examples Customizing Workflows

4-34 Application Administrators Guide for Content Server 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 NewEdit 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. 12. Test the script before saving it. See step 1 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. ■ Jump Example 1: Metadata Criteria Jump on page 4-34 ■ Jump Example 2: Time-dependent Jump on page 4-35

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 wfSetwfJumpName, BypassGraphics Caution: If you clear the Custom Script Expression check box, the expression reverts to its original definition; all modifications will be lost. Managing Workflows 4-35 wfSetwfJumpTargetStep, wfCurrentStep1 wfSetwfJumpEntryNotifyOff, 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 parseDatewfCurrentGetlastEntryTs dateCurrent-7 wfSetwfJumpName, LateApproval wfSetwfJumpTargetStep, NotifyAuthorApprovalPeriodExpired wfSetwfJumpMessage, The review period for content item evaldDocTitle has expired. wfSetwfJumpReturnStep, wfCurrentStep0 wfSetwfJumpEntryNotifyOff, 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: ■ Creating Templates and Scripts on page 4-36 ■ Creating a Workflow Template on page 4-36 ■ Changing a Workflow Template on page 4-36 ■ Deleting a Workflow Template on page 4-37 ■ Creating a Script Template on page 4-37 Important: When you use a workflow template, you must change the reviewers if they are different from those defined in the selected template.