Search in sources :

Example 1 with ScriptTask

use of org.camunda.bpm.model.bpmn.instance.ScriptTask in project camunda-bpmn-model by camunda.

the class ScriptTaskImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ScriptTask.class, BPMN_ELEMENT_SCRIPT_TASK).namespaceUri(BPMN20_NS).extendsType(Task.class).instanceProvider(new ModelTypeInstanceProvider<ScriptTask>() {

        public ScriptTask newInstance(ModelTypeInstanceContext instanceContext) {
            return new ScriptTaskImpl(instanceContext);
        }
    });
    scriptFormatAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_SCRIPT_FORMAT).build();
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    scriptChild = sequenceBuilder.element(Script.class).build();
    /**
     * camunda extensions
     */
    camundaResultVariableAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_RESULT_VARIABLE).namespace(CAMUNDA_NS).build();
    camundaResourceAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_RESOURCE).namespace(CAMUNDA_NS).build();
    typeBuilder.build();
}
Also used : Task(org.camunda.bpm.model.bpmn.instance.Task) ScriptTask(org.camunda.bpm.model.bpmn.instance.ScriptTask) ScriptTask(org.camunda.bpm.model.bpmn.instance.ScriptTask) SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Aggregations

ScriptTask (org.camunda.bpm.model.bpmn.instance.ScriptTask)1 Task (org.camunda.bpm.model.bpmn.instance.Task)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 SequenceBuilder (org.camunda.bpm.model.xml.type.child.SequenceBuilder)1