Decision Evaluate via REST with complex Object

1,047 views
Skip to first unread message

Bernd Rücker

unread,
Jan 16, 2016, 4:53:51 AM1/16/16
to camunda-...@googlegroups.com

Hey guys.

 

I do a POST to http://localhost:8080/engine-rest/engine/default/decision-definition/key/notwendigeKompetenz/evaluate according to https://docs.camunda.org/manual/7.4/reference/rest/decision-definition/post-evaluate/

 

I want to hand over a Java Object to rule evaluation. So I do the same I would do when starting a process instance:

{

                "variables": {

                               "claim": {

                                               "value": "{\"type\":\"Unfall KFZ\",\"expenditure\":\"100\"}",

                                               "type": "Object",

                                               "valueInfo": {

                                                               "serializationDataFormat": "application/json",

                                                               "objectTypeName": "com.camunda.demo.dmntraining.taskrouting.Claim"

                                               }

                               }

                }

}

 

But it seems that in this case Spin is not used to deserialize the JSON to a Java Object?

 

I get this stack trace:

 

10:48:11,172 WARNING [ExceptionHandler] (default task-27) org.camunda.bpm.engine.rest.exception.RestException: Cannot evaluate decision notwendigeKompetenz:1:d6

        at org.camunda.bpm.engine.rest.sub.repository.impl.DecisionDefinitionResourceImpl.evaluateDecision(DecisionDefinitionResourceImpl.java:150)

 

 

Caused by: org.camunda.bpm.engine.ProcessEngineException: Exception while evaluating decision with id 'notwendigeKompetenz:1:d68b39e4-bc1d-11e5-a86f-984920524153'

        at org.camunda.bpm.engine.impl.dmn.cmd.EvaluateDecisionByIdCmd.doEvaluateDecision(EvaluateDecisionByIdCmd.java:70)

        at org.camunda.bpm.engine.impl.dmn.cmd.EvaluateDecisionByIdCmd.execute(EvaluateDecisionByIdCmd.java:61)

        at org.camunda.bpm.engine.impl.dmn.cmd.EvaluateDecisionByIdCmd.execute(EvaluateDecisionByIdCmd.java:38)

        at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)

        at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:95)

        at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:58)

        at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)

        at org.camunda.bpm.engine.impl.DecisionServiceImpl.evaluateDecisionTable(DecisionServiceImpl.java:47)

        at org.camunda.bpm.engine.impl.DecisionServiceImpl.evaluateDecisionTableById(DecisionServiceImpl.java:34)

        at org.camunda.bpm.engine.rest.sub.repository.impl.DecisionDefinitionResourceImpl.evaluateDecision(DecisionDefinitionResourceImpl.java:133)

        ... 48 more

Caused by: org.camunda.bpm.dmn.engine.impl.DmnEvaluationException: DMN-01002 Unable to evaluate expression for language 'juel': '${claim.type}'

        at org.camunda.bpm.dmn.engine.impl.DmnEngineLogger.unableToEvaluateExpression(DmnEngineLogger.java:32)

        at org.camunda.bpm.dmn.engine.impl.DefaultDmnDecisionContext.evaluateElExpression(DefaultDmnDecisionContext.java:329)

        at org.camunda.bpm.dmn.engine.impl.DefaultDmnDecisionContext.evaluateExpression(DefaultDmnDecisionContext.java:297)

        at org.camunda.bpm.dmn.engine.impl.DefaultDmnDecisionContext.evaluateInputExpression(DefaultDmnDecisionContext.java:217)

        at org.camunda.bpm.dmn.engine.impl.DefaultDmnDecisionContext.evaluateInput(DefaultDmnDecisionContext.java:112)

        at org.camunda.bpm.dmn.engine.impl.DefaultDmnDecisionContext.evaluateDecisionTable(DefaultDmnDecisionContext.java:93)

        at org.camunda.bpm.dmn.engine.impl.DefaultDmnEngine.evaluateDecisionTable(DefaultDmnEngine.java:95)

        at org.camunda.bpm.engine.impl.dmn.invocation.DecisionTableInvocation.invoke(DecisionTableInvocation.java:52)

        at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:54)

        at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocationInContext(DefaultDelegateInterceptor.java:86)

        at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:58)

        at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor$1.call(DefaultDelegateInterceptor.java:52)

        at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor$1.call(DefaultDelegateInterceptor.java:49)

        at org.camunda.bpm.engine.impl.context.ProcessApplicationClassloaderInterceptor.call(ProcessApplicationClassloaderInterceptor.java:44)

        at org.camunda.bpm.application.AbstractProcessApplication.execute(AbstractProcessApplication.java:109)

        at org.camunda.bpm.engine.impl.context.Context.executeWithinProcessApplication(Context.java:186)

        at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:49)

        at org.camunda.bpm.engine.impl.util.DecisionTableUtil.invoke(DecisionTableUtil.java:86)

        at org.camunda.bpm.engine.impl.util.DecisionTableUtil.evaluateDecisionTable(DecisionTableUtil.java:81)

        at org.camunda.bpm.engine.impl.dmn.cmd.EvaluateDecisionByIdCmd.doEvaluateDecision(EvaluateDecisionByIdCmd.java:67)

        ... 57 more

Caused by: java.lang.IllegalStateException: Object is not deserialized.

        at org.camunda.bpm.engine.variable.impl.value.ObjectValueImpl.getValue(ObjectValueImpl.java:86)

        at org.camunda.bpm.engine.impl.el.VariableContextElResolver.unpack(VariableContextElResolver.java:73)

        at org.camunda.bpm.engine.impl.el.VariableContextElResolver.getValue(VariableContextElResolver.java:42)

        at org.camunda.bpm.engine.impl.javax.el.CompositeELResolver.getValue(CompositeELResolver.java:231)

        at org.camunda.bpm.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:81)

        at org.camunda.bpm.engine.impl.juel.AstProperty.eval(AstProperty.java:52)

        at org.camunda.bpm.engine.impl.juel.AstEval.eval(AstEval.java:50)

        at org.camunda.bpm.engine.impl.juel.AstNode.getValue(AstNode.java:26)

        at org.camunda.bpm.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)

        at org.camunda.bpm.engine.impl.dmn.el.ProcessEngineElExpression.getValue(ProcessEngineElExpression.java:43)

        at org.camunda.bpm.dmn.engine.impl.DefaultDmnDecisionContext.evaluateElExpression(DefaultDmnDecisionContext.java:325)

        ... 75 more

 

My fault? Bug? Missing Feature?

 

Thanks and cheers

Bernd

Bernd Rücker

unread,
Jan 19, 2016, 8:45:46 AM1/19/16
to camunda-...@googlegroups.com

Anybody?

--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/DB5PR06MB0966F727B78520A9F904D90AE8CE0%40DB5PR06MB0966.eurprd06.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

Sebastian Menski

unread,
Jan 19, 2016, 11:44:52 AM1/19/16
to camunda BPM users
Hi Bernd,

as you didn't provided an example it took some time to reproduce. ;)

And also I wasn't able to reproduce it. 

And the request:
POST /engine-rest/process-definition/key/testProcess/start HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 303
Content-Type: application/json
Host: localhost:8080
User-Agent: HTTPie/0.9.2

{
    "variables": {
        "claim": {
            "type": "Object", 
            "value": "{\"type\":\"Unfall\"}", 
            "valueInfo": {
                "objectTypeName": "org.camunda.bpm.example.Claim", 
                "serializationDataFormat": "application/json"
            }
        }
    }
}

HTTP/1.1 200 OK
Content-Type: application/json
Date: Tue, 19 Jan 2016 16:42:25 GMT
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked

{
    "businessKey": null, 
    "caseInstanceId": null, 
    "definitionId": "testProcess:1:abb66746-bec9-11e5-8ebf-0242c1341b97", 
    "ended": true, 
    "id": "9ec50a4e-becb-11e5-aa10-0242c1341b97", 
    "links": [
        {
            "method": "GET", 
            "rel": "self"
        }
    ], 
    "suspended": false
}


I used latest tomcat 7.5.0-SNAPSHOT.

Does this example fail in your setup?

Cheers,
Sebastian

Bernd Rücker

unread,
Jan 19, 2016, 11:48:58 AM1/19/16
to camunda-...@googlegroups.com

Great – thanks!

So I take this as „should work” and will investigate further. Thanks a lot! I basically wasn’t sure if it is supported and should work or not…

--

You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages