Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
stevenlee100

Member
Registered:
Posts: 24
Reply with quote  #1 
Hi again,

Apologies if this is another dumb question, but I'm trying to raise a flag from my C# script using the RaiseFlag method provided...

RaiseFlag(Text flagName, Text folderId, object[] arguments);

The first two parameters are self-explanatory, but the third parameter has stumped me. I'm guessing I use this parameter to pass my flag parameters, but the type 'object' is a bit vague.

Can anyone shed some light?

Thanks in advance, Steve.
0
stevenlee100

Member
Registered:
Posts: 24
Reply with quote  #2 
Just worked out, I use Flags.MyFlags rather than RaiseFlag.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #3 
You need to pass in a string array (ie string[]). I am not sure what other objects would work, but I assume it would just call the ToString() function on each object. Interestingly, with many Metastorm objects that just returns the type, which may be unexpected.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
Nappy

Avatar / Picture

Guru
Registered:
Posts: 1,087
Reply with quote  #4 

ps there are no dumb questions ;)


__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.

PS that's for V6/7 for V9 the problem is V9 at the moment ;)
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #5 
the only dumb questions are the ones you don't ask....

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
nice83

New Member
Registered:
Posts: 3
Reply with quote  #6 
and how to raise flag in process from c# which exists in attached library?
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #7 
Mstm.RaiseFlag() should do it.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
nice83

New Member
Registered:
Posts: 3
Reply with quote  #8 
will be there any possibility to use it just like flag created in process eg Flags.FlagName(flagParameter1, flagParameter2) ? For now we have this possibility draging flag from toolbox (toolbox see flags created in library)

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #9 
Yes, you can.

If you create a new project, and add a flag, you can access this in code like so:
Quote:
Metastorm.Runtime.Models.Project1.Flags.Flag1(<params>)

I am assuming this raises the flag as it makes no sense otherwise, but assumption is the mother of all stuff-ups, as we know.

__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
moo

Veteran
Registered:
Posts: 184
Reply with quote  #10 
Hi, would someone be able to post an example of raising a flag in C#
I am getting an error when using the following:
Mstm.RaiseFlag(sqlFlagResult,sqlFolderResult,"'" + User + "','" + Body + "','" + Action + "'");
 
I have tried doing .ToString on each of the values
sqlFlagResult is the flag name, sqlFolderResult is the folder id and the remaining User, Body and Action are the paramaters but i cannot get it to accept these parameters.
 
Thanks
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #11 
You need to pass in the parameters as specified in the doco and the intellisense pop up. Something like:
Mstm.RaiseFlag("MyFlag","MyFolderId", Mstm.ListItems("aaa","bbb"));


__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
moo

Veteran
Registered:
Posts: 184
Reply with quote  #12 
Hi, brilliant, that worked, thank you. This is what my code now looks like:

Mstm.RaiseFlag(sqlFlagResult,sqlFolderResult,Mstm.ListItems(User,Body,Action));

0
Nils

Member
Registered:
Posts: 23
Reply with quote  #13 
I just spend a few hours on this... 

just to prevent others from this... if you do use Mstm.RaiseFlag, please notice, that it does NOT need the "Name" property in it's List Items. It seems, you don't have to provide the default parameters. 


0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #14 
No, you don't. You never did. The format is exactly the same as it was in version 7, although the ability to add a variable number of additional parameters (in a C# function) has been ignored, so you now have to add the data being passed as a List, is all.
__________________
Post an example, and we will have a much better idea what the problem is. In about 90% of posts, the problem is one of communication. Examples bridge that gap.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!