Video Screencast Help
Symantec Appoints Michael A. Brown CEO. Learn more.

Creating Custom Complex Data Types in Workflow Solution

Created: 24 Apr 2009 • Updated: 09 Sep 2010 | 8 comments
ChrisBern's picture
+5 5 Votes
Login to vote

Complex data types make our lives a whole lot easier in Workflow Solution, and it's critical to use them skillfully in our Workflow projects.  This 13-minute video walks you through the process of creating your own complex data type as part of a very basic hardware request project.  Once we create the custom data type, we will then use it to structure several pieces of information from a hardware request into a single variable, which we will then display in the body of an email and on a web form for review.

Keywords: Complex data type, create integration libary, user defined type, generator, webforms, add new data element, grid component, browse data, array, send email, html table from collection

Comments 8 CommentsJump to latest comment

Aryanos's picture

Hi Chris,

This was a really informative video as it gives the designer a lot of flexibility to create their own data types. Is it possible to build some kind of logic in how we want to display the items? For example, it  the user does not check the item is there a way to exclude them from showing up on the summary page and in the email?

I like my beats fast and my bass down low

+1
Login to vote
ChrisBern's picture

In this particular video's example, we are simply displaying the array back in our final form builder's grid component.  However, if we wanted to reduce our array to only those elements which were "true" for the true/false (boolean) datatype element "RequestThisItem", we could do it this way:

In the grid component, instead of directly choosing "Item Source" for the array to display, I would choose Dynamic Model.  Then in the model, I would put a submodel like the screenshot below.  The submodel will loop through the MyHardwareRequest array via the For Each Element In Collection component.  In that component, I've called my Item Output Variable Name something like ThisItem...that's my "this loop item", which will change to the next element in the array with every loop through it.  Out of the Next Element path, then, I will check my ThisItem.RequestThisItem property against a True False Rule component.  If that property is true, then I go back to my For Each Element component because I don't want to change anything.  If that property is false, however, I will remove the ThisItem element from the MyHardwareRequest array, via the Remove Items From Collection component, and then return back to my For Each Element component to loop through once more.  Once all of the looping is done, the submodel will go to the End component, where you must do a data mapping "Value from Data" to MyHardwareRequest.  This step defines the ultimate output of the Dynamic Model, because remember we're telling this grid component that we are going to be displaying content dynamically...so with the End component mapping, we define what that dynamic content will be.  Make sense?

imagebrowser image

+1
Login to vote
Aryanos's picture

Hi Chris,

Thanks I got this to work. I was having some issues with it removing all the items from the array but found out that I was using the wrong variable in the Remove Items From Collection component.

I like my beats fast and my bass down low

+1
Login to vote
Aryanos's picture

I'm working on a hardware request form that has multiple forms that users go through selecting different hardware similar to the Dell website. I've created different data types for the various hardware that we have and now have to display the hardware the user has selected on a summary page so it displays only displays the items that they have selected.  Is there a way to merge the information together so I can display it in a HTMLMergeComponent or will have have to be displayed in multiple grid components?

I like my beats fast and my bass down low

+1
Login to vote
ChrisBern's picture

At first glance, I'd probably write the information out to a database.  If you were writing out to a database, it'd be easier to "grab" the information nicely through SQL joins, reporting tools, etc., for both display purposes and permanent audit trail information.  There are a lot of considerations, though, and it really depends on the big picture of the project and what you're trying to accomplish.

Yes you can display data from different arrays on the same web form.  Roughly speaking, I'd use a Merge HTML component to get your different array information into one nice HTML-formatted variable.  Then you can display the HTML variable on a Form Builder via an IncludeHtmlComponent.  I demonstrated something similar to this in this video:  https://www-secure.symantec.com/connect/videos/how-send-http-post-workflow-0

This is all relatively easy to do.  The only tricky part is making the HTML look nice in the Merge HTML component.  This should get you started, but you'll have to experiment with what looks good:

  a) In the Merge Data of the Merge HTML component, change the dropdown from the default String Formatter, to Table from Array.  You should see your available arrays now on the left-hand side. 
  b) Drag Array-->[*]-->PropertyName over to the blank area on the right-hand side.
  c) Highlight the item you just dragged over (it'll look like ArrayName[*].PropertyName)
  d) While highlighted, you'll have a bunch of new options on the lower-left hand side.  You are creating a table with which to display your data.  For Caption, optionally put the name of your table.  Checkmark Show Headers.  In the Columns section, click the Plus button to add the other properties from your array that you want to display.  You will have to type in the variable (property) name, so get the name exact.

Try that and play around with the formatting, etc.  This should at least get you started in the direction of showing data from multiple arrays in a more flexible way than having multiple grids on a page.

+2
Login to vote
Sean Chivers's picture

I'm glad you mentioned writing your complex data types out to database for audit purposes and future reference etc. This is because i'm keen to do this myself. To illustrate what I mean, I'll use the Customer Servey in SD7 as an excellent example:

In the workflow I'm building, I've:

  • Created a custom data set to hold a large number of custom variables in SD.DATA integration library (in same way as the survey).
  • I've introduced this list of variables into my workflow using the add new data element and transfered it to an set of working data variables just like 'survey' called 'NewApplication' (survey writes it's out to 'incident'), and further down the workflow;
  • After a set of forms for user input, HTML Merged the content of the form fields into a single variable and;
  • ..piped this variable into a 'create ticket (incident ticket) component.

This is a web forms project which I will publish to the servicedesk Service Catalogue.

What I need to do now, is add in the workflow a component or set of components, which effectively:

Write the content of the user entered variables into a (in sql speak) 'table' if you like, so the user entered data is committed to the Ensemble database somewhere; then

have this set of components somehow create a join (in sql speak again) from my newly commited data, to the Incident record I've created.

This is because I need to then write some custom Smart Tasks which will want to draw on the data taken from the form (now associated with the incident through some kind of join) in order to perform further  actions as a ServiceDesk technician (ie retrieving approvals for the application using the affected user from the form by linking to the stored data).

Given what I've done so far, can you suggest any additional components to my workflow to commit this data to table (or xml doesn't really matter what medium I assume) and create the join. I am also unsure where these components should sit - ie at the start of the workflow or at the end. It's worth noting I think that the new ticket is generated at the end, so I'd expect one or the other of these components would need to be triggered after the ticket is generated...

I hope this makes sense, my knowledge of how to store data to database, linking it to a ServiceDesk Ticket, and making it accessible to other workflow projects after that, is a little vague at my current knowledge level.

I think if I can sort this theory out, I can leap ahead with our user interaction from within our Incident records.

0
Login to vote
telegon's picture

I clicked on the video and some guys talking about Disaster recovery?

+1
Login to vote
ChrisBern's picture

Sorry, some wires must be crossed...the Complex Data Video Types video is no longer being shown here.   I'll get with the Connect team to get this fixed.  In the meantime, you can download the Flash video file from the attachment above...it's named Complex_Data_Types.flv.  You can watch it with a Flash video player, e.g. VLC Media Player (just one example).  Thanks for pointing this out.

+1
Login to vote