本文整理汇总了Java中org.activiti.engine.impl.bpmn.data.ItemDefinition类的典型用法代码示例。如果您正苦于以下问题:Java ItemDefinition类的具体用法?Java ItemDefinition怎么用?Java ItemDefinition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ItemDefinition类属于org.activiti.engine.impl.bpmn.data包,在下文中一共展示了ItemDefinition类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseMessages
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
/**
* Parses the messages of the given definitions file. Messages are not
* contained within a process element, but they can be referenced from inner
* process elements.
*
* @param definitionsElement
* The root element of the XML file/
*/
public void parseMessages() {
for (Element messageElement : rootElement.elements("message")) {
String id = messageElement.attribute("id");
String itemRef = this.resolveName(messageElement.attribute("itemRef"));
String name = messageElement.attribute("name");
MessageDefinition messageDefinition = new MessageDefinition(this.targetNamespace + ":" + id, name);
if(itemRef != null) {
if(!this.itemDefinitions.containsKey(itemRef)) {
addError(itemRef + " does not exist", messageElement);
} else {
ItemDefinition itemDefinition = this.itemDefinitions.get(itemRef);
messageDefinition.setItemDefinition(itemDefinition);
}
}
this.messages.put(messageDefinition.getId(), messageDefinition);
}
}
示例2: testAsyncInvocationWithDataFlowUEL
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
@Deployment
public void testAsyncInvocationWithDataFlowUEL() throws Exception {
assertEquals(-1, counter.getCount());
ProcessDefinitionEntity processDefinition = processEngineConfiguration
.getCommandExecutorTxRequiresNew()
.execute(new Command<ProcessDefinitionEntity>() {
public ProcessDefinitionEntity execute(CommandContext commandContext) {
return Context
.getProcessEngineConfiguration()
.getDeploymentCache()
.findDeployedLatestProcessDefinitionByKey("asyncWebServiceInvocationWithDataFlowUEL");
}
});
ItemDefinition itemDefinition = processDefinition.getIoSpecification().getDataInputs().get(0).getDefinition();
ItemInstance itemInstance = itemDefinition.createInstance();
FieldBaseStructureInstance structureInstance = (FieldBaseStructureInstance) itemInstance.getStructureInstance();
structureInstance.setFieldValue("newCounterValue", 23);
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("dataInputOfProcess", itemInstance);
processEngine.getRuntimeService().startProcessInstanceByKey("asyncWebServiceInvocationWithDataFlowUEL", variables);
waitForJobExecutorToProcessAllJobs(10000L, 250L);
assertEquals(23, counter.getCount());
}
示例3: testWebServiceInvocationWithDataFlowUEL
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
@Deployment
public void testWebServiceInvocationWithDataFlowUEL() throws Exception {
ProcessDefinitionEntity processDefinition = processEngineConfiguration
.getCommandExecutorTxRequiresNew()
.execute(new Command<ProcessDefinitionEntity>() {
public ProcessDefinitionEntity execute(CommandContext commandContext) {
return Context
.getProcessEngineConfiguration()
.getDeploymentCache()
.findDeployedLatestProcessDefinitionByKey("webServiceInvocationWithDataFlowUEL");
}
});
ItemDefinition itemDefinition = processDefinition.getIoSpecification().getDataInputs().get(0).getDefinition();
ItemInstance itemInstance = itemDefinition.createInstance();
FieldBaseStructureInstance structureInstance = (FieldBaseStructureInstance) itemInstance.getStructureInstance();
structureInstance.setFieldValue("prefix", "The counter has the value ");
structureInstance.setFieldValue("suffix", ". Good news");
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("dataInputOfProcess", itemInstance);
ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByKey("webServiceInvocationWithDataFlowUEL", variables);
waitForJobExecutorToProcessAllJobs(10000L, 250L);
String response = (String) processEngine.getRuntimeService().getVariable(instance.getId(), "dataOutputOfProcess");
assertEquals("The counter has the value -1. Good news", response);
}
示例4: parseMessages
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
/**
* Parses the messages of the given definitions file. Messages are not
* contained within a process element, but they can be referenced from inner
* process elements.
*
* @param definitionsElement
* The root element of the XML file/
*/
public void parseMessages() {
for (Element messageElement : rootElement.elements("message")) {
String id = messageElement.attribute("id");
String itemRef = this.resolveName(messageElement.attribute("itemRef"));
if (!this.itemDefinitions.containsKey(itemRef)) {
addError(itemRef + " does not exist", messageElement);
} else {
ItemDefinition itemDefinition = this.itemDefinitions.get(itemRef);
MessageDefinition message = new MessageDefinition(this.targetNamespace + ":" + id, itemDefinition);
this.messages.put(message.getId(), message);
}
}
}
示例5: parseProperty
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
/**
* Parses one property definition.
*
* @param propertyElement
* The 'property' element that defines how a property looks like and
* is handled.
*/
public void parseProperty(Element propertyElement, ActivityImpl activity) {
String id = propertyElement.attribute("id");
String name = propertyElement.attribute("name");
// If name isn't given, use the id as name
if (name == null) {
if (id == null) {
addError("Invalid property usage on line " + propertyElement.getLine() + ": no id or name specified.", propertyElement);
} else {
name = id;
}
}
String itemSubjectRef = propertyElement.attribute("itemSubjectRef");
String type = null;
if (itemSubjectRef != null) {
ItemDefinition itemDefinition = itemDefinitions.get(itemSubjectRef);
if (itemDefinition != null) {
StructureDefinition structure = itemDefinition.getStructureDefinition();
type = structure.getId();
} else {
addError("Invalid itemDefinition reference: " + itemSubjectRef + " not found", propertyElement);
}
}
parsePropertyCustomExtensions(activity, propertyElement, name, type);
}
示例6: createMessages
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
public void createMessages() {
for (Message messageElement : bpmnModel.getMessages()) {
MessageDefinition messageDefinition = new MessageDefinition(messageElement.getId(), name);
if (StringUtils.isNotEmpty(messageElement.getItemRef())) {
if (!this.itemDefinitions.containsKey(messageElement.getItemRef())) {
bpmnModel.addProblem(messageElement.getItemRef() + " does not exist", messageElement);
} else {
ItemDefinition itemDefinition = this.itemDefinitions.get(messageElement.getItemRef());
messageDefinition.setItemDefinition(itemDefinition);
}
}
this.messages.put(messageDefinition.getId(), messageDefinition);
}
}
示例7: initializeXSDItemDefinitions
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
protected void initializeXSDItemDefinitions() {
this.itemDefinitions.put("http://www.w3.org/2001/XMLSchema:string", new ItemDefinition("http://www.w3.org/2001/XMLSchema:string",
new ClassStructureDefinition(String.class)));
}
示例8: MessageDefinition
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
public MessageDefinition(String id, ItemDefinition itemDefinition) {
this.id = id;
this.itemDefinition = itemDefinition;
}
示例9: getItemDefinition
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
public ItemDefinition getItemDefinition() {
return this.itemDefinition;
}
示例10: setItemDefinition
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
public void setItemDefinition(ItemDefinition itemDefinition) {
this.itemDefinition = itemDefinition;
}
示例11: getItemDefinitions
import org.activiti.engine.impl.bpmn.data.ItemDefinition; //导入依赖的package包/类
public Map<String, ItemDefinition> getItemDefinitions() {
return itemDefinitions;
}