Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 535.7K On-Premises Infrastructure
- 138.1K Analytics Software
- 38.6K Application Development Software
- 5.6K Cloud Platform
- 109.3K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
OnDemand Rule

Hi,
We have created two simple calculate rules
Rule1
Sub OnDemand_test123(bLog)
'ID:442
'PROPERTIES:logging=false;timer=false;disabled=false;CalcType=Calculate
'STARTCOMPONENT:FORMULA
'ID:-317
'NAME:Template-1-317
'PROPERTIES:logging=false;timer=false;disabled=false;CalcType=Calculate
'
If 1 = 1 Then 'NEWBLOCKCOND
HS.Exp "A#10101002.I#[ICP None].Material#[None].Future1#[None].Region#[None].Funct_Area#Opening Balance = 90000"
End If
'ENDCOMPONENT
End Sub
Rule2
Sub OnDemand_testing(bLog)
'ID:444
'PROPERTIES:logging=false;timer=false;disabled=false;CalcType=Calculate
'STARTCOMPONENT:FORMULA
'ID:-314
'NAME:Template-1-314
'PROPERTIES:logging=false;timer=false;disabled=false;CalcType=Calculate
'
If 1 = 1 Then 'NEWBLOCKCOND
HS.Exp "A#10101001.I#[ICP None].Material#[None].Future1#[None].Region#[None].Funct_Area#Opening Balance = 8000"
End If
'ENDCOMPONENT
End Sub
Which i am able to calculate if i use calculate/force calculate option
Rule Calculated
But when i use ondemand option i am getting error.
Executing OnDemand rule
Error
Kindly guide what to do? or am i using it wrong?
Regards
i,
We have created simple calculate rule which i am able to excecute when i use calculation option on web from. But when i do the same for on_demand rule... it is getting errored out.
Kindly find the attached word document stating the issue in detail with screen shots.
Regards
Best Answer
-
I assume these rules come from Calc Manager, and that you have displayed the script to make the posting here easier for everyone to read. If my guess is correct, the issue lies with Calc Manager, not your rules. Notice that each time we create a new rule object in calc manager, a variable 'blog' is attached to the subroutine. This is used by Calc Manager to enable or disable logging. The issue however, is that On Demand rules can't accept a parameter since they need to run independently. Sub On Demand works just fine with classic script rules, but because of Calc Manager's design to automatically insert the variable, OnDemand rules can't run for applications using calc manager.
My advice to you is to find a way to simply use Sub Calculate instead and give up on using OnDemand for this application. When I explained this issue to Oracle last year I was under the impression that they knew about it, but did not have a fix forthcoming.
If anyone on this forum has found a clever workaround for OnDemand with Calc Manager, I'm eager to learn.
- Chris
Answers
-
I assume these rules come from Calc Manager, and that you have displayed the script to make the posting here easier for everyone to read. If my guess is correct, the issue lies with Calc Manager, not your rules. Notice that each time we create a new rule object in calc manager, a variable 'blog' is attached to the subroutine. This is used by Calc Manager to enable or disable logging. The issue however, is that On Demand rules can't accept a parameter since they need to run independently. Sub On Demand works just fine with classic script rules, but because of Calc Manager's design to automatically insert the variable, OnDemand rules can't run for applications using calc manager.
My advice to you is to find a way to simply use Sub Calculate instead and give up on using OnDemand for this application. When I explained this issue to Oracle last year I was under the impression that they knew about it, but did not have a fix forthcoming.
If anyone on this forum has found a clever workaround for OnDemand with Calc Manager, I'm eager to learn.
- Chris
-
Hi,
Sorry for late reply. Yes i have created these rules in calc mgr. Can't i just remove the 'blog' from the script that calc mgr creates? (i did tried it though calc manager puts it back)
"Sub On Demand works just fine with classic script rules" by this i am guessing that we can create VB scripts without the help of calc mgr and execute them?
Is it possible?
Regards
-
Hi. Yes, you can edit the rules without Calculation Manager with a text editor. This is called “Classic” script. There is an addin for Notepad++ that can help with this, although it is not required. If you do this then you’ll have to do without things like member lookup, function lookup, etc. But there are advantages too. If you look at the sample apps that come with HFM you’ll see some examples.
I would not try to alternate between CM and Classic. If you make the switch, then stick with Classic.
Eric
-
Thanks for help.
Since i am using ondemand i will stick to classic vb scripts.
Regards