Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
paulsiu

Senior Member
Registered:
Posts: 57
Reply with quote  #1 

I need to call a .Net assembly from Jscript.net.

 

Here’s what I am doing, I created a class with the following code:

 

using System;

using System.Collections.Generic;

using System.Text;

 

namespace IHOP.METARPA

{

    public class MetastormEncryption

    {

        public static string test()

        {

            return "Success";

        }

    }

}

 

The DLL is compile and then copied to the dotnetbin folder in the Metastorm Engine and Designer. I call the script form the Jscript.Net

 

import System;

import eWork.Engine.ScriptObject;

import IHOP.METARPA;

 

package Metastorm.Extensions

{

    public class Encryption

    {

        public static function test(ework: Object, args: Object[] ) : Object

        {

            return MetastormEncryption.test();

        }

    }

}

 

I restarted the engine, but the engine won’t compile the Jscript.net. It errors out with:

 

Event Type:        Error

Event Source:    Metastorm Process Engine

Event Category:                eServerConfigurer

Event ID:              45

Date:                     5/9/2012

Time:                     2:30:57 PM

User:                     N/A

Computer:          DEVE3MET002

Description:

Unable to precompile JScript .net script for map Unavailable, procedure myProcedure, version 392. Reason: Error(60019236) : Variable 'MetastormEncryption' has not been declared, at line 24. Source:             return MetastormEncryption.test();

.

Error(60019236) : The plus operator is a slow way to concatenate strings. Consider using System.Text.StringBuilder instead, at line 111. Source:                     result += ", ";

.

Error(60019236) : The plus operator is a slow way to concatenate strings. Consider using System.Text.StringBuilder instead, at line 112. Source:                     result += inner.Message;

.

 

For some reason, it can’t see the class. What am I doing wrong?

Paul

0
paulsiu

Senior Member
Registered:
Posts: 57
Reply with quote  #2 
Quote:
Originally Posted by paulsiu

I need to call a .Net assembly from Jscript.net. I am using Metastorm 7 and the assembly are compiled as .Net 2.0.

 

Here’s what I am doing, I created a class with the following code:

 

using System;

using System.Collections.Generic;

using System.Text;

 

namespace IHOP.METARPA

{

    public class MetastormEncryption

    {

        public static string test()

        {

            return "Success";

        }

    }

}

 

The DLL is compile and then copied to the dotnetbin folder in the Metastorm Engine and Designer. I call the script form the Jscript.Net

 

import System;

import eWork.Engine.ScriptObject;

import IHOP.METARPA;

 

package Metastorm.Extensions

{

    public class Encryption

    {

        public static function test(ework: Object, args: Object[] ) : Object

        {

            return MetastormEncryption.test();

        }

    }

}

 

I restarted the engine, but the engine won’t compile the Jscript.net. It errors out with:

 

Event Type:        Error

Event Source:    Metastorm Process Engine

Event Category:                eServerConfigurer

Event ID:              45

Date:                     5/9/2012

Time:                     2:30:57 PM

User:                     N/A

Computer:          DEVE3MET002

Description:

Unable to precompile JScript .net script for map Unavailable, procedure myProcedure, version 392. Reason: Error(60019236) : Variable 'MetastormEncryption' has not been declared, at line 24. Source:             return MetastormEncryption.test();

.

Error(60019236) : The plus operator is a slow way to concatenate strings. Consider using System.Text.StringBuilder instead, at line 111. Source:                     result += ", ";

.

Error(60019236) : The plus operator is a slow way to concatenate strings. Consider using System.Text.StringBuilder instead, at line 112. Source:                     result += inner.Message;

.

 

For some reason, it can’t see the class. What am I doing wrong?

Paul

0
PresuminEd

Avatar / Picture

Member
Registered:
Posts: 25
Reply with quote  #3 

Suggestion:  try setting your "JScriptPrecompileLevel" DWORD engine registry setting to 0 (zero).   You can find it here:

 

HKLM\SOFTWARE\Metastorm\e-work\Engine

 

or here:

 

HKLM\SOFTWARE\Wow6432Node\Metastorm\e-work\Engine

 

Restart your engine, and see how you get on...

 

Cheers,

Ed.

 


__________________
Any comments I make are mine alone, and do not necessarily reflect the views of my employer...May contain nuts...Open other side up...Contents may have settled during transportation...
0
bigfootger

Veteran
Registered:
Posts: 139
Reply with quote  #4 

I might be wrong, but maybe it helps.

 

I usually create an instance of my class first and then call the methods?

 

Just a guess, without testing loading up my MBPM v7 VM.

 


__________________
Metastorm BPM Remote Expert Help & Web Consultations - http://connect.convedo.com/free-1-hour-web-consultation
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!