Replicating Camunda Service Task with Element Template ( Creating Connector )

Hi Team,
I am trying to create one Connector where I am getting one value from form , Now I want to store same value in another variable Target as below shown(field should be zeebe:input )


I tried same to replicate in my connector , But I am not able to achieve source and target

Here Below is my template

Any Suggestion or solution is appreciable
Thanks and Regards
Avinash

I haven’t started working on templates yet, so take this with all due caution.

In your template, try changing

{
    "Label": "Account ID",
    "description": "This variable will store Account ID",
    "value": "=accountID",
    "type": "string",
    "editable": true,
    "optional": true,
    "binding": {
        "type": "zeebe:input",
        "name": "accountID"
    }
}

to

{
    "Label": "Account ID",
    "description": "This process variable is where the connector can find the Account ID",
    "value": "=source",
    "type": "string",
    "editable": true,
    "optional": true,
    "binding": {
        "type": "zeebe:input",
        "name": "target"
    }
}

And run it against the same working service that you were using in your manual configuration.

Templates are designed to help those who are generating models to fill out the information in the correct way, so some of the underlying information gets hidden. My understanding is that the block for binding is mapped to the input variable that you list, and the source comes from the value portion.

1 Like

Thanks @GotnOGuts , I implemented as you told


The thing is what my doubt as you can see down manually it is asking target variable but here in our case we are giving in JSON template as we have one input field. I tried with two input fields one to take value from source another take input variable to store that value.

I have given below configuration in JSON

Still not able to achieve ,
Thanks &Regards
Avinash

I’m not following what you’re trying to convey.
The screenshot that you shared (with 3 “target” variables) is not using your template.

Start simple.

  1. Build your process with C8 service worker tasks
    1.1 This version of the process will have “Inputs” and “Outputs”
    1.2 This version of the process will have a service worker that will connect to Zeebe to collect the work to be done, mapping process variables into worker variables. In the very original screenshot, you were mapping process variable “source” into worker variable “target”
  2. Test the process and make fixes until this works
  3. Build a template that will replace the “generic” service worker task
  4. Update the process to use the template
  5. Test the process

If you are trying to configure your connector to map a process variable to a service worker variable, and then when activity complete map a service worker variable to a process variable, then the binding for the second block needs to be of type zeebe:output and the name in the binding block will be the service worker’s variable name. The value in the parent block represents what the process variable will be.

Posting screenshots of your template actually makes it harder for us to see and provide feedback. You can post the JSON using Markdown with the code blocks by starting a line with three back-ticks ( ``` ) and then pasting the code, then closing the code block by starting a line with 3 back-ticks.

{
    "Label": "Process to Worker",
    "description": "This process variable will be available to the worker process as workervariableinput",
    "value": "=processvariable1",
    "type": "string",
    "editable": true,
    "optional": true,
    "binding": {
        "type": "zeebe:input",
        "name": "workervariableinput"
    }
},
{
    "Label": "Worker to Process",
    "description": "The worker process must set variable workerprocessoutput and we will move it to the process variable named here",
    "value": "=processvariable2",
    "type": "string",
    "editable": true,
    "optional": true,
    "binding": {
        "type": "zeebe:output",
        "name": "workerprocessoutput"
    }
}
1 Like

Thank you @GotnOGuts , Actually what my doubt is , I will explain properly, So below you can see template containing two fields Description and Account ID

  1. Description is Input field which is getting some data from UI( Task Form) in Description Variable.
  2. Account ID is output field which is Storing ID in variable ( accountVar ) given by us.

    So How we stored Account Id in accountVar variable, same way I want to store Description value in input variable (descVar) ,. This I want to achieve , Can suggest me some idea or suggestion ?
    Here Below my element template

Thank you
Avinash Rawat
Software Developer
Acheron Software Consultancy

Did you try what was suggested before?