Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #1 
I just can;'t see how this should e done.

I want to pass ProcessContext.ProcessName, ProcessContext.FolderId

It wants a single text parameter for the arguments. Now I could, if I felt so inclined, build a complicated string concatenating it all together, but that seems a wast of time. I thought I could have multiple values here. I can when calling from the Formula Builder, for example.

The doco states:
Quote:

Activity Name

Execute Stored Procedure

Description

Use this activity to execute a database stored procedure which returns NO value.

Property Name

Description

Connection

Provide a valid connection to the required data source.

Name of Procedure

Provide the name of the stored procedure to execute.

Set Parameter Values

Provide any parameter values that the stored procedure takes. The value for the Parameters argument can be entered as follows:

@MyParam1=My Value1,

@MyParam2=My Value 2

and that does not seem to work properly from the Visual Script activity. Have I missed something, am I going mad, or is it just broken?

__________________
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  #2 

you are probably going mad over all the broken and or missing stuff.....


__________________
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  #3 
Quote:
Originally Posted by Nappy

you are probably going mad over all the broken and or missing stuff.....

sure got that right. I have been trying to get our training together, but to be honest I've been spending 75% of the time investigating issues and going "WTF?". On the plus isde, we have a good library in the making, and some admin tools, and we are going to give them away for free as a promotional item (the first one's free....;)

This one I am not setting as a fault just yet, but only because the doco is so poor that I cannot tell. If anyone else can, that would be great.

__________________
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
chernoa

Member
Registered:
Posts: 14
Reply with quote  #4 
strProcName = "CLAIM_SAVE_POLICY_LINK";
strParms = "@CLAIM_ID='"+claimID+"',@POLICY_DETAILS_ID='"+pdid+"',@HISTORY_ID="+pdhisid+",@INSURED_PARTY_ID='"+ipid+"'";
dt = ExecuteProcedure(new TransactorUS(), strProcName, strParms);

It does not work. What do I do wrong?

0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #5 
What error do you get?

__________________
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
chernoa

Member
Registered:
Posts: 14
Reply with quote  #6 
Details:Failed to execute deployed method 'WhenChanged', using entity 'Command1'. Exception 'Exception 'Error converting data type nvarchar to int.' occurred when attempting to 'Execute stored procedure'.' occurred when attempting to 'Execute workflow '2c3cdbfa-0613-467a-b2a9-fb4b32299817''. Exception 'Error converting data type nvarchar to int.' occurred when attempting to 'Execute stored procedure'.

_________________________________

Stack Trace: at Metastorm.Engine.Connectors.ExternalMboConnector.ExecuteStoredProcedure(String procedureName, IList`1 parameters) at Metastorm.Engine.Runtime.FolderMethods.ExecuteProcedure(String name, String connectionString, IList`1 parameters) at Metastorm.Runtime.Core.Mstm.ExecuteProcedure(MboConnectionInfo connection, Text procedureName, SerializableDictionary`2 parameters) at Metastorm.Runtime.Core.Mstm.ExecuteProcedure(MboConnectionInfo connection, Text procedureName, Text parameters) at Metastorm.Runtime.Core.Scripts.Activities.MstmActivity.ExecuteProcedure(MboConnectionInfo connection, Text procedureName, Text parameters) at Metastorm.Runtime.Models.ClaimProj.CreateClaim.Declarations.CreateClaim_Command1_OnButtonPressed.Declarations.CodeActivity1.Execute(ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.CompositeActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutionFilter.Execute(Activity activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.Execute(Activity activity, ActivityExecutionContext executionContext) at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime) at System.Workflow.Runtime.Scheduler.Run()

0
chernoa

Member
Registered:
Posts: 14
Reply with quote  #7 
I opened the ticket with Metastorm support. THey will try to develop a small solution to illustrate how to use Execute Stored Procedure function. If they will not be able to do it, they will move the ticket to Level 2987 support :):):)
0
Griff

Member
Registered:
Posts: 38
Reply with quote  #8 
Give this solution example a try.

Griff

 
Attached Files
zip ExecuteStoredProcedureSolution.zip (47.86 KB, 98 views)

0
rkushner

New Member
Registered:
Posts: 2
Reply with quote  #9 
As a favor to people who don't want to go thru the useless hassle of a zip & solution & project & form & button...

The answer is:

"@parm1=" + bo.field1 + ", @parm2=" + bo.field2
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #10 
Quote:
Originally Posted by rkushner
As a favor to people who don't want to go thru the useless hassle of a zip & solution & project & form & button...

The answer is:

"@parm1=" + bo.field1 + ", @parm2=" + bo.field2
Well, there are few problems with this approach. Most importantly you will be forced to format all parameters manually. This means trapping for quotes in text fields, and setting dates correctly.

In our experience it is a great deal easier to use SelectSql(), but be aware that you cannot use named parameters as in the above example, which is a huge problem generally.

__________________
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
Nils

Member
Registered:
Posts: 23
Reply with quote  #11 
I did have a lot of problems with this approach, since I did try to insert strings and intergers into the stored procedure call.

This worked for me:

 

string param1 = "Test";
var paramDict = new SerializableDictionary<string, object>();
paramDict.Add("@StringParameter", param1);
paramDict.Add("@Debug", 0);
 
Mstm.ExecuteProcedure(new MetastormDefault(), "myStoredProcedure", paramDict);
 
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!