Hi,
I am trying to deploy a decision table. When I deploy by making the decision as a classpath resource, the decision gets deployed, but when I deploy the decision by adding it as a input stream , it doesnt get deployed and upon evaluating the decision I get an error as follows :
org.camunda.bpm.engine.exception.NotFoundException: no decision definition deployed with key ‘artifactdecision’: decisionDefinition is null
Is there any way to make it work by adding it as an input stream. Code I used :
InputStream is = new FileInputStream(temp);
byte [] content = IOUtil.toByteArray(is);
DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService()
.createDeployment().tenantId(appId).addInputStream(resourceName, new ByteArrayInputStream(content));
deploymentBuilder.deploy();
Any input will really be helpful, as I am struggling with this.
Thanks.
Make sure your resourceName variable is a String that ends on .dmn or .dmn11.xml. This is required for the engine to recognize the resource as a DMN XML file and parse it accordingly.
Hello @thorben,
Thanks for reminding me the power of unit tests. As I was doing an evaluation, I didnot think about writing some. I could see the exceptions much more clearly and am now able to run the model !!
Thanks again.
Thanks @Vinodlouis for your inputs as well.
Sure, I got the following errors :
1.Unable to resolve variable ‘DATAFILE’ in expression ‘DATAFILE’ : which points out that there is something wrong with the way the input value has been put in the .dmn file. In this case, I didnt wrap the input values with a “”.
2. DMN-01002 Unable to evaluate expression for language ‘juel’: ‘${artifact_Key}’. This points out something wrong with the input variable value. In my case, a typo:confounded:
Earlier, instead of the above errors I kept getting the error mentioned in the first post. That confused me, once I wrote the test case I could see the errors much more clearly.