Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
KarlD

Avatar / Picture

Guru
Registered:
Posts: 113
Reply with quote  #1 
How do we access process variables from within a JScript.NET script? I've got a JScript.NET function that needs to access, both read and write, the process variables for a specific process.

Does anyone have any examples in JScript.NET for doing this in version 9.1?

Cheers.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #2 
I never liked the implementation as it was too awkward. I do recall it was something like ework("<variable>") or similar. I am sure it is the Designer help and manual.

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

Guru
Registered:
Posts: 688
Reply with quote  #3 
"JScript.NET" implies V7 of BPM, not V9 (which used C# and business objects).

However, in JScript.NET the following works:
to read a value from the process:  ework.CustomVariable("<vname>");
to write to a value in the process:  ework.CustomVariable("<vname>",<value>);

defining ework: SyncProcessData (provided in the "shell" sync method when creating a new JScript.NET script.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #4 
Quote:
Originally Posted by BMellert
"JScript.NET" implies V7 of BPM, not V9 (which used C# and business objects).

However, in JScript.NET the following works:
to read a value from the process:  ework.CustomVariable("<vname>");
to write to a value in the process:  ework.CustomVariable("<vname>",<value>);

defining ework: SyncProcessData (provided in the "shell" sync method when creating a new JScript.NET script.


Oooh! I missed the context. I would not even think of using a script in version 9. C# all the way, mateys!

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

Avatar / Picture

Guru
Registered:
Posts: 113
Reply with quote  #5 
Thanks Guys.

I have an integration item that is accessed via JScript.NET that needs to pull through some of the variables from the process and I thought it might be easier to get the JScript.NET to pull the data directly that to rewrite the integration item so that it can be called from C#.

I guess that sometimes there just isnt an easy way. I should know better by now.
0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #6 
Grit your teeth and rewrite in C#. In the long run it has so many advantages anyway. I am so glad to leave script behind!

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

Senior Veteran
Registered:
Posts: 429
Reply with quote  #7 
Bit weird as I was looking at the designer manual (yes things do get that bad) and under server scripting it implies you can use Jscript.net or C# but in the designer unlike clientside scripting where you can select the script language serverside has no option to specify the language which implies you must use C#.


0
Jerome

Avatar / Picture

Guru
Registered:
Posts: 5,507
Reply with quote  #8 
I think somehow they are supported if migrated from 7, but you cannot create new ones.

I'm convinced that is a good thing, but I'm sure others will disagree.


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