Application Center - Maplesoft

App Preview:

Creating Task Templates

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image 

Creating Task Templates 

? Maplesoft, a division of Waterloo Maple Inc., 2009 

Introduction 

Task templates provide convenient, fill-in-the-blank problem solving. Templates can use point-and-click components, turning them into mini-calculators, or provide the command or sequence of commands that you need to accomplish your task, so you can simply ?fill in the blanks? with your own values to find the solution.  Maple comes with over 250 built-in task templates, and it lets you add your own custom templates for your own use and to share with others.  Creating custom task templates is an effective way to reduce the time required to perform repetitive or complex multi-step operations, and to simplify tasks for novice users. Document-style task templates can also be used to create standardized reports within your organization. 

To create a custom task template, you first create all of the content that you would like to be included in your task template. Once created, you can give content optional markers to make your task template more robust. You then save your task template to a help database of your choosing. Once saved, you have the option to share your task template with others. 

 

In this Tips and Techniques, we give a brief overview on using task templates, and then explain how to create your own custom templates and save them into a Maple help database so they can be re-used and shared. 

 

Using Task Templates 

To use task templates, you simply browse to the desired template and insert it into your document. You can then fill out the required fields and execute it as you would any other content in your Maple document. 

 

 

Step 

Result 

Select Tools > Task > Browse... 

Image 

You will now see a list of task templates in the left pane of the Browse Tasks window. You can expand folders and click on any task to preview it. The preview displays in the right pane of the window. 

 

Select Curve Fitting > B?zier Curves. You will see a preview of this task template in the right window. 

 

Select Insert Default Content.  

 

(Selecting Insert Minimal Content will insert the task template without non-essential content such as titles, descriptions, and other template embellishments.) 

Image 

The task template will be inserted into your document after your cursor. You can then use and modify the task template just as you would any content in your Maple document. If there were any placeholders, you would first add your own content into these placeholders. This task template, however, has opted for embedded components to simplify the inputting and execution of mathematics. 

 

Tip: Embedded components are extremely useful in all Maple documents - not just task templates. Learn more about embedded components here

Generate B?zier Curves 

A B?zier curve is a polynomial determined by a set of points in such a way that it interpolates the first and last points, but has its shape determined by the remaining points.  This task allows you to interactively define the points and view the curve. 

 

B?zier Curves 

  • Use the slider to select n, the degree of the B?zier curve.
 

 

n = Embedded component 

 

  • Press Initialize to initialize/clear the plot window.
 

  • Click to insert `+`(n, 1) control points  Make sure that the pointer is Image, execute code.
 

  • Drag control points to modify the B?zier curve.
 

  • Below, find the B?zier curve
 


R = sum(`*`(`^`((binomial(n, k))(`+`(1, `-`(u))), `+`(n, `-`(k))), `*`(`^`(u, k), `*`(P[k]))), k = 0 .. n)  

Embedded component 

Embedded component 

 

 

Creating a Task Template 

To create a task template, you start with a blank document, just as you normally would in Maple. You then create content for your task template, using tables, embedded components, text and math.  For the purposes of this Tips and Techniques, a simple task template has already been constructed to demonstrate the different features of custom task templates. 

 

Example: Transfer Function and Bode Plot 

The custom task template shown here takes a function func and displays its corresponding transfer function and Bode plot.  

 

Image 

Figure 2: This is what our task template looks like when it is being created with the option View > Task Elements enabled. The highlighted content has been marked to have special features when inserted into your document - see the section below on Placeholders, Optional, and Non-Insert content. 

 

Previously Assigned Variables 

It is possible that a task template will use variable names that are already assigned in the worksheet into which it is being inserted. For that reason, it is important that all parameter and variable names in custom task templates are enclosed by double underscores. For our example, we enclose the variable func as __func__.  Enclosing these in double underscores prompts Maple to check and see if the variable name has been assigned earlier in the document. If it has, Maple will prompt you to enter a new name for the variable that will be inserted. 

 

Image 

Figure 2: When you insert a task template with a variable name that is already in use, you are prompted by Maple to enter a new name in the New Name  

column - in this case, func2

 

Tip: When editing variable names, you may find that typing an underscore [_] places your cursor in the subscript position when you actually wanted to type in the underscore symbol. You can instruct Maple to insert the underscore symbol itself by typing a forward slash [\] first, followed by an underscore. 

 

 

Placeholders, Optional, and Non-Insert Content 

When creating task templates, you may want to control which of your content is immediately visible when the template is inserted into a worksheet, and you may want to help guide a user through filling out your template. Maple provides some options to make this possible. 

 

Placeholders 

Placeholders are parameters which are meant to be replaced by the user once the task has been inserted into a worksheet. They typically include expressions, variables, and options. The text or math will appear in purple, rather than the default black font. 

 

To mark content as a placeholder, highlight the content and select Format > Task Authoring > Mark As Placeholder. The color of the content will change to indicate that you have successfully marked it as a placeholder.  

 

In our example above, we have set the variable f as a placeholder. 

 

Tip: When you set variables as placeholders, you can then tab through them just as if you were inserting an expression from the Expression Palette. 

 

Optional Content 

Optional content is content in your task template that is inserted only when the user inserts it by clicking on the Insert Default Content. Inserting a task template by clicking on Insert Minimal Content will not insert any optional content. This is useful if you only wish to insert the parts of the task template that are necessary for its functionality. Content such as titles, descriptions, and other embellishments are usually marked as optional. 

 

To mark content as optional, highlight the content and select Format > Task Authoring > Mark As Optional.  

 

In the example above, the optional content is highlighted blue. 

 

Non-Insert Content 

Non-insert content is content that only appears in the browsing section of the task templates library. This content will not be inserted into your worksheet regardless of the insertion method you choose. Content typically marked for non-insertion includes sections that would be included in help files, such as See Also sections, but there are no limits to what can be marked for non-insertion. 

 

To mark content as non-insertion, highlight the content and select Format > Task Authoring > Mark As Non-Insert. 

 

Non-insert content in our example above is highlighted red. 

 

 

Tip: To view which of your content has been marked as placeholders, optional content, or non-insert content, go to View > Task Elements. Placeholders appear highlighted green, optional content appears highlighted blue, and non-insert content appears highlighted red. 

 

Saving the Task Template 

When you are finished creating your task template, you must save it into a help database so that it can be used. To save the file into a help database, follow these steps: 

 

 

Step 

Result 

Select Tools > Help Database > Save as Task... 

Image 

Specify a database file under Select Writable Database. The default database is already filled in, so you can leave this untouched unless you want to specify a new database file. Maple will automatically create the database file if it does not already exist. 

 

Image 

Specify a unique Task Name that describes your task. 

Give your task a Table of Contents Entry. This will be the location of the task when it is viewed in the Browse Tasks window.  

Optionally, you can give your variables descriptions. This can be useful if the user needs to rename a variable due to previously saved variable names. The description will provide useful information on the use of that variable. 

Click Save. Your task template will now be visible in the Browse Tasks window. 

Image 

 

Sharing the Task Template 

After you have saved your task template, you may wish to share it with others. To share your task template, follow these steps: 

 

Step 

Result 

Navigate to the "lib" folder in your Maple installation directory. For example, the default Maple 12 installation "lib" folder is located at C:\Program Files\Maple 12\lib

Image 

Select the help database (HDB) file that you have your task saved to. For example, in the above section on saving task templates, we used the default HDB file named StdWsTask_en.hdb

 

Copy this file and send it to your recipient. 

Image 

Instruct the recipient of your HDB file to place it in the same location. If the file of the same name already exists, you can rename the original file StdWsTask_en_Original.hdb

 

When the recipient opens Maple and browses for task templates, they will now have access to your tasks. 

Image 

 

 

Legal Notice: ? Maplesoft, a division of Waterloo Maple Inc. 2008. Maplesoft and Maple are trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit activities.