digitalstate / camunda-spock-testing Goto Github PK
View Code? Open in Web Editor NEWSpock Framework Specification Testing / Unit Testing for Camunda BPM Engine/Processes
License: MIT License
Spock Framework Specification Testing / Unit Testing for Camunda BPM Engine/Processes
License: MIT License
def spinVar = runtimeService().getVariable(executionId, 'myJSON')
println spinVar.getClass().getSimpleName()
JacksonJsonNode
def processInstanceId = processInstance.getProcessInstanceId()
def historicVariableInstanceQuery = historyService().createHistoricVariableInstanceQuery().processInstanceId(processInstanceId)
historicVariableInstanceQuery.list().each{
println "${it.getName()} : ${it.getTypeName()}: ${it.getClass()}"
}
import static org.camunda.spin.Spin.*;
....
def json = JSON("{\"customer\": \"Kermit\"}")
def variableMap = ['myJSON':json]
def processInstance = runtimeService().startProcessInstanceByKey("myProcess", variableMap)
Ability to keep core engine loaded to reduce test retry times
Deployment and Deletion of deployment would still occur
many functions are easier to access
import static org.hamcrest.CoreMatchers.is;
// import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.both;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasProperty;
def processInstanceId = processInstance.getProcessInstanceId()
def historicVariableInstanceQuery = historyService().createHistoricVariableInstanceQuery().processInstanceId(processInstanceId)
assertThat(historicVariableInstanceQuery.list(), hasItems(
both(hasProperty("name", equalTo("myJSON"))).and(instanceOf(org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity.class)),
both(hasProperty("name", equalTo("mySpinVar"))).and(instanceOf(org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity.class)),
));
def executionId = processInstance.getId()
def spinVar = runtimeService().getVariable(executionId, 'myJSON')
assert spinVar.getClass().getName() == 'org.camunda.spin.impl.json.jackson.JacksonJsonNode'
Currently when you deploy
@Deployment(resources = ["bpmn/ExternalScriptTest/myProcess.bpmn", "bpmn/ExternalScriptTest/file.js" ])
you get a:
cannot find deployment://file.js error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.