How to use rule templates in Kie Workbench?

211 Views Asked by At

I have installled and have deployed a few rules files to kie server using drools workbench. But now I want to use template files to be used and create drl files out it and then deploy those rules witk kie workbench. I have found an option to add template file such as Guided Rule Template. But the source cannot be edited. Usually when we define templates files we start with a template header. A sample template file is shown below.

template header
    frequency
    memory
    power

package com.myspace.test;

import com.myspace.test.GPU;

template "power-for-gpu"

rule "Choice recommended power supply for GPU_@{row.rowNumber}"

when
    $gpu : GPU(frequency ==@{frequency}, memory== @{memory})
then
    $gpu.setPower(@{power})
end

end template

but the Guided Rule Template doesn't seems to be in the above manner. It starts with package and no template header can be found or created default. There is no option for defining variables. Its generated source looks like rule file and not template. Is there anyway to define and use templates in kie workbench.

0

There are 0 best solutions below