Interactive Questions In Service Manager

May 17, 2010

How to Create and Use Interactive Questions

If your workflow is like most, you will more than likely have the necessity to ask questions at some point in the process.    Service Manager can make stopping a save process by interjecting user interaction a difficult process.

Since ServiceCenter 6.0 and the introduction of Service Manager, Javascript has been a great tool used to perform more complicated parts of system workflow and validations.  However, Javascript does still have some drawbacks.  Not all Javascript commands are available for use within Javascript.    Even though you may be able to write valid Javascript to call an interactive functions and/or RAD applications in Service Manager,  any interactive calls are likely to crash your Service Manager client application.  Because of this limitation, Javascript cannot be used to solicit user information in the validations on the format control.

There are many solutions to this.  Each solution has a number of pros and cons associated with it.  The key with any of the solutions is to intercept the save process prior to entering the normal processing.

Part I:  Surveying the Solutions

Create a Wizard

If your process requires more than a single piece of information collected from your user, or your process has information that needs to be presented with visual formatting, creating a wizard may be the best alternative.  Wizards may have one or more screens as well as a series of screens and information presented to the user.  Additionally, wizards have the capability to perform branching, requesting dynamic content and even presenting process around cancelling from a wizard.

Create Wizard HP SM (click for full size)

The screen shot above illustrates a set of out of the box wizards that can be used when a user rejects a change.  Wizards may view information from one or more files, run embedded code, Javascript and call formatctrl.  Wizards offer a great amount of flexibility for complex solutions.  However, this may not be the best choice for simpler needs.

Out Of Box RAD Applications

Service Manager features a number of RAD applications that can request information from a user and return that data to the application.

Each application has subtle differences in the functionality and returned data or values.  For our example, we are going to use the RAD application, object.yes.no to pose a question with a Yes or No reply to the user.

The object.yes.no takes several parameters:

  • The first is the text parameter.  Text contains the data or prompt to be presented to the user.
  • The boolean1 value identifies whether the cancel button will be available as an option.  Acceptable values for this are true or false.
  • The prompt parameter contains the name of a Service Manager variable that will hold the response coming from this call.

RAD Object Yes/No (Click for full size)

The example above is being called from a Process record.  Object.yes.no will only be called if there is data to be presented to the user, which is contained in the Service Manager variable $question.  Since boolean1 is false, cancelling from this function is not an option.  Lastly, the users response will be returned from object.yes.no through the Service Manager variable $returncode.

Place a Temporary Field on the Form

In some situations where screen real estate is not an issue and where you do not want to annoy the user with extra screen pops every time they perform an action, a field can be placed on the form that can initiate additional code at save time or can even stop or abort the process.

Several examples are illustrated below.

Notify Owner can initiate notification processing when the ticket is saved.  The value behind the field can be a stored value in the database or can be provided as an interim transient value that disappears every time it is used.

Fields presented on tickets may have DEFAULT values, be required entry or may indicate optional workflow.  This field, when selected, would perform the additional workflow needed to complete and close the ticket.

Which Solution is best?

Each one of these solutions is equally valid and useful.  Which solution is best for your particular situation depends on your specific design and process needs.  Some things to think about when selecting a solution:

  • Do you want to prevent the user from taking an action until data is collected?
  • Do you want to respond to a users action?
  • Do you want to perform additional processing when an action is selected?

Part II:  Where to Implement

Now that our process has directed us to one or more solutions, where does the solution get implemented in Service Manager to cause the least amount of disruption to the existing system?   Because of the interactive nature of  the data being requested, none of the calls below may be made through Javascript.   Some of the solutions below may be combined to implement the best solution.

Format Control

If the solution requires a response before an action is taken (add, update, close) and the solution utilizes values on the form, format control may be the best location.  Format Control can perform calculations on values, perform validation on a value or require additional validations dependent on data in other fields.

Format Control does not work well as a vehicle to conditionally prompt the user and alter workflow in the save process based on the user’s response.

Process

Service Manager Process records offer an excellent place to call conditional workflow.  A Process may execute its own expressions and Javascript and may call one or more RAD applications in a single Process.  These records offer excellent methods of gathering information and acting on the answers.  Processes may call RAD applications (object.yes.no) and/or may call wizards to perform additional processing.

Additionally, Processes may call other Processes and be linked together as required.  Inserting a line into the beginning or the middle of an existing process may prove irritating.  There is no insert command so each set of information below the insertion point would need to be moved by hand.  Or, the new Process may be added as an additional record that calls the existing one.  Be forewarned.  If you choose to place your Process in front of another process, all calls to the original process will also need to be adjusted and changed.

Another option for implementing as a Process is to implement the call to your Process as a callout from your displayoption.  Read on for how to deploy a Process via a Displayoption.

DisplayOption

Display Options are invoked when a user presses a button or other type of event in Service Manager (eg: save).  The display option may be self-contained or in turn execute a display action that invokes a Process.  However, the display option may also call a single RAD application to perform some processing prior to execution of outside instructions.  The result of any expressions or code executed as part of the display option may be used to alter the display action that is executed.

Display options may call any RAD application so it is also perfectly valid to invoke a wizard or interactive message box RAD application from here as well.  The screen below illustrates the calling of a process from within a display option.

Change Display Option (click for full size)

The example above shows a Change Display option that is calling a Process (my.message.functions) to request user interaction.  Once the Process is complete, control will be passed back to this display option.  If all has gone well, the intent it to execute the “save” display action in the upper right corner.

Save Display Option (click for full size)

On the post expressions tab, the variable $returncode that was set in our process is being checked.  If the user answered yes, the save is aborted by modifying our display action.

Putting It All Together

Now you have seen how different solutions and implementations may be used to assist in the deployment of interactivity in Service Manager.  A solution may not offer the desired results in every situation so it is beneficial to know multiple ways to deploy eloquent solutions.


Comments

No Comments Yet.

Got something to say?





Spam Protection by WP-SpamFree

Contact Us

Laura Walker
Director of Business Development
Office: 701-232-5697 x27
Mobile: 701-306-7774
Email: lwalker@stratacominc.com

Client Testimonial

“As the project progressed through the various phases, StrataCom demonstrated their customer service commitment. A high level of responsiveness both in day-to-day support as well as with the deliverables assigned to them was realized. StrataCom became a true partner with us and the project team genuinely felt that our success was a priority for them. As a partner, StrataCom actively performed knowledge transfer and mentored our technical staff, accelerating our learning curve with the product.” ~Client Project Manager