Open jeromesimeon opened 4 years ago
^^^ @dselman
Note, this also mean that logicless templates, currently, cannot be open in template studio:
@jeromesimeon while investigating this issue, I was working with ergo-engine code. I found out the following behaviour.
(node:29066) UnhandledPromiseRejectionWarning: TypeNotFoundException: Namespace is not defined for type org.accordproject.runtime.State
at APModelManager.getType (/home/user/Desktop/templateHandling/node_modules/@accordproject/concerto-core/lib/modelmanager.js:569:19)
at Serializer.fromJSON (/home/user/Desktop/templateHandling/node_modules/@accordproject/concerto-core/lib/serializer.js:149:52)
at LogicManager.validateInput (/home/user/Desktop/templateHandling/node_modules/@accordproject/ergo-compiler/lib/logicmanager.js:324:39)
at VMEngine.invoke (/home/user/Documents/ergo/packages/ergo-engine/lib/engine.js:170:34)
at VMEngine.init (/home/user/Documents/ergo/packages/ergo-engine/lib/engine.js:215:21)
at Engine.init (/home/user/Desktop/templateHandling/node_modules/@accordproject/cicero-engine/lib/engine.js:85:32)
at main (/home/user/Desktop/templateHandling/index.js:20:30)
.
I guess v0.22.0 still must be in development so just thought of reporting this behaviour to you.
Hello @jeromesimeon , I wanted to test a template with formulae but without logic. Can you please suggest a template that I can use for the same?
I guess v0.22.0 still must be in development so just thought of reporting this behaviour to you.
It's expected. Not really because Ergo 0.22
is still an alpha version (although, of course it is), but simply because that new version is a breaking change so we have to make changes to template studio to support it.
Hello @jeromesimeon , I wanted to test a template with formulae but without logic. Can you please suggest a template that I can use for the same?
Look in the template library for templates without a logic directory (I think there are a few).
Hello @jeromesimeon , I wanted to test a template with formulae but without logic. Can you please suggest a template that I can use for the same?
Look in the template library for templates without a logic directory (I think there are a few).
@sanketshevkar I think I read your question a little fast. I don't think there is one without logic but with formulae... Someone will have to try and create one!
@jeromesimeon I have searched templates in cicero template library, but found none.
Also, I was curious that what would be the cases where there could be a need to initialize
and trigger
templates without logic? Since no logic involved, there is no state type, request type, response type and emit type associated with it.
If we want to initialize
these templates we'll need at least need a state type and a response type associated with it. Is that correct?
@jeromesimeon I have searched templates in cicero template library, but found none.
Also, I was curious that what would be the cases where there could be a need to
initialize
andtrigger
templates without logic? Since no logic involved, there is no state type, request type, response type and emit type associated with it.If we want to
initialize
these templates we'll need at least need a state type and a response type associated with it. Is that correct?
Those are all good question. I think it depends how you think of "no logic" is it really no logic, or is it "empty logic" in which case you could have a default initialisation to an empty state and no request would trigger execution but the trigger call could still exist.
Thank you @jeromesimeon. I think this problem is better handled from the ergo packages than cicero. I am trying the same. Would that be the correct thing to do?
Also, do all templates need to have a contractName? I am the same signature block template you used above. I'm getting a error in ergo-engine because the contractName is null.
(node:11895) UnhandledPromiseRejectionWarning: Error: Cannot create invoke call for target: cicero without a contract name
at LogicManager.getInvokeCall (/home/user/Documents/ergo/packages/ergo-compiler/lib/logicmanager.js:144:23)
at VMEngine.invoke (/home/user/Documents/ergo/packages/ergo-engine/lib/engine.js:180:34)
at VMEngine.init (/home/user/Documents/ergo/packages/ergo-engine/lib/engine.js:227:21)
at Engine.init (/home/user/Desktop/templateHandling/node_modules/@accordproject/cicero-engine/lib/engine.js:85:32)
@sanketshevkar I think it could probably be handled directly in template studio? This would be worth investigating as it's much less intrusive. (i.e., not do the invoke call in the first place)
@jeromesimeon, yeah I'll investigate this approach too. But then cicero init
& cicero trigger
would still fail.
I have changed some code on the ergo-engine
and ergo-compiler
v0.21.9 to solve this issue. Should I create a PR for that?
@jeromesimeon, yeah I'll investigate this approach too. But then
cicero init
&cicero trigger
would still fail.I have changed some code on the
ergo-engine
andergo-compiler
v0.21.9 to solve this issue. Should I create a PR for that?
Right. yes sorry I confused two different issues here maybe. If we do want to support initialise
even in the absence of user-logic, it's quite possible that doing it in Ergo as you suggest would be better. And sure, if you have something to review, I'll be happy to take a look!
@jeromesimeon, yeah I'll investigate this approach too. But then
cicero init
&cicero trigger
would still fail. I have changed some code on theergo-engine
andergo-compiler
v0.21.9 to solve this issue. Should I create a PR for that?Right. yes sorry I confused two different issues here maybe. If we do want to support
initialise
even in the absence of user-logic, it's quite possible that doing it in Ergo as you suggest would be better. And sure, if you have something to review, I'll be happy to take a look!
Hi @jeromesimeon,
I have created a PR for the ergo respository.
Is your feature request related to a problem? Please describe. Currently:
parse
anddraft
but no other command (e.g.,initialize
ortrigger
)This can be a bit surprising, especially
cicero initialize
sometimes works when there is no logic (e.g., when a formula is in the template grammar).Also this means testing logicless templates is somewhat cumbersome / different from other templates.
This can also mean some API calls will throw lower-level exceptions for logicless templates in some cases.
Describe the solution you'd like More uniform handling of templates with or without logic. For instance:
initialize
clause)Additional context Example with the signature block template from https://templates.accordproject.org/signature-block-title-name-date@0.19.0.html