Video Screencast Help

Altiris Workflow generate a sequence Form Number

Created: 09 May 2013 • Updated: 20 May 2013 | 4 comments
Candyip's picture
This issue has been solved. See solution.

Hi all,

I want to generate a Form number automatic and this number is unique and sequenced. The number format IT/0001.

How can I do this ??

Operating Systems:

Comments 4 CommentsJump to latest comment

reecardo's picture

I'm assuming you mean numbering of tasks here

If you have Reporting turned on in your WF project (check Add Process Component on the Reporting tab of Project Properties), you can specify a prefix (in your case it's be IT) and a Pad Length (in your case I believe it would be 4). However, the slash character will be a hyphen: IT-0001.

To do this just on the stream, you'd just use some String Handling components to build the number:

Add New Data Element component to add a string "IT\"

Add New Data Element component to add your integer counter... starting at 1

Pad Text component to pad with 0's

Merge Text component to merge your prefix with your padded counter.

Hope that makes sense.

SOLUTION
Candyip's picture

For the Add New Data Element component to add a string "IT\" and Add New Data Element component to add your integer counter, what data tpye should I select ?

 

 

rhamner's picture

To create a unique sequential value like this it's best to use a database. You need someplace to store the last used value.

Is this a workflow project? If so why not use the process reporting id like recardo suggested?

Otherwise, it depends on what you're trying to accomplish. Are you already saving any database records? If you have an identity column (auto number) you can pad that ID with 0's and add the IT\ to the front.

Another option could be to use stored procedure generator to create a component that calls SP_GenerateNextReportID stored procedure in Process Manager database. Use value for 'type' parameter that won't interfere with other workflows, like a random guid. This will return the next # for a given 'type' passed in. Then you can pad that identity value it returns with 0's and add the IT\ to the front.

Candyip's picture

Hi rahmner,

It is a workflow project , in the project property  I have click  Add Process Component, but I dont know how to get the number and show in my web form.Would you mind give  me more information  about this, thanks.