private void addExecutionListener(BaseElement element, string eventName) { ExtensionElements extensionElements = element.ModelInstance.newInstance(typeof(ExtensionElements)); ModelElementInstance executionListener = extensionElements.addExtensionElement(CAMUNDA_NS, "executionListener"); //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: executionListener.setAttributeValueNs(CAMUNDA_NS, "class", typeof(ModelExecutionContextExecutionListener).FullName); executionListener.setAttributeValueNs(CAMUNDA_NS, "event", eventName); element.ExtensionElements = extensionElements; }
private void deployProcess(string eventName) { BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(PROCESS_ID).startEvent().userTask(USER_TASK_ID).endEvent().done(); ExtensionElements extensionElements = modelInstance.newInstance(typeof(ExtensionElements)); ModelElementInstance taskListener = extensionElements.addExtensionElement(CAMUNDA_NS, "taskListener"); //JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method: taskListener.setAttributeValueNs(CAMUNDA_NS, "class", typeof(ModelExecutionContextTaskListener).FullName); taskListener.setAttributeValueNs(CAMUNDA_NS, "event", eventName); UserTask userTask = modelInstance.getModelElementById(USER_TASK_ID); userTask.ExtensionElements = extensionElements; deploymentId = repositoryService.createDeployment().addModelInstance("process.bpmn", modelInstance).deploy().Id; }