Creates a task instance unless the INSTANCE_ID_VAR attribute points
to a pre-existing instance.  If the attribute is populated but the variable
value is null, the variable will be set to the newly-created instanceId.
333099
@Override
    public void execute() throws ActivityException {
        Long instanceId = null;  // pre-existing instanceId
        String instanceIdSpec = getInstanceIdVariable();
        if (instanceIdSpec != null) {
            Object value = getValue(instanceIdSpec);
            if (value instanceof Long)
                instanceId = (Long) value;
            else if (value != null)
                instanceId = Long.parseLong(value.toString());
        }
        try {
            if (instanceId == null) {
                TaskInstance taskInstance = createTaskInstance();
                instanceId = taskInstance.getTaskInstanceId();
                if (instanceIdSpec != null)
                    setValue(instanceIdSpec, instanceId);
            }
            else {
                // update secondary owner
                updateOwningTransition(instanceId);
            }

            String taskInstCorrelationId = TaskAttributeConstant.TASK_CORRELATION_ID_PREFIX + instanceId;
            super.loginfo("Task instance created - ID " + instanceId);
            if (this.needSuspend()) {
                getEngine().createEventWaitInstance(
                        this.getActivityInstanceId(),
                        taskInstCorrelationId,
                        EventType.EVENTNAME_FINISH, true, true);
                EventWaitInstance received = registerWaitEvents(false,true);
                if (received!=null)
                        resume(getExternalEventInstanceDetails(received.getMessageDocumentId()),
                                         received.getCompletionCode());
            }
        } catch (Exception e) {
            throw new ActivityException(-1, e.getMessage(), e);
        }
    }
1030849
function createThisVar(id) {
    var nstr = "this_" + id.replace(/\_/g, "__")
    thisVars.push(nstr)
    return nstr
  }
317939
public void addVariable(String attribute, String varName, String value) {
	Bindings binds = rslTree.getBindings(attribute);
	if (binds == null) {
	    binds = new Bindings(attribute);
	    rslTree.put(binds);
	}
	binds.add(new Binding(varName, value));
    }
301980
def initialize_copy(original)
      instance_variables.each do |ivar|
        instance_variable_set(ivar, DataMapper::Ext.try_dup(instance_variable_get(ivar)))
      end

      self.persistence_state = persistence_state.class.new(self)
    end
358487
@Override
	protected void putVariables(Map<String, String> variables) {
		variables.put(ScopeFormat.SCOPE_HOST, hostname);
		variables.put(ScopeFormat.SCOPE_TASKMANAGER_ID, taskManagerId);
	}
1172102
public static BigtableDataClient create(String projectId, String instanceId) throws IOException {
    BigtableDataSettings settings =
        BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build();
    return create(settings);
  }
738245
public void addVariable(VariableInitializer v) {
        assertNotNull(v);
        variables.add(v);
        v.setParent(this);
    }
1261566
@Override
  public void recordHistoricDetailVariableCreate(VariableInstanceEntity variable, ExecutionEntity sourceActivityExecution, boolean useActivityId) {
    if (isHistoryLevelAtLeast(HistoryLevel.FULL)) {

      HistoricDetailVariableInstanceUpdateEntity historicVariableUpdate = getHistoricDetailEntityManager().copyAndInsertHistoricDetailVariableInstanceUpdateEntity(variable);

      if (useActivityId && sourceActivityExecution != null) {
        HistoricActivityInstanceEntity historicActivityInstance = findActivityInstance(sourceActivityExecution, false, false);
        if (historicActivityInstance != null) {
          historicVariableUpdate.setActivityInstanceId(historicActivityInstance.getId());
        }
      }
    }
  }
114310
def varbind(name, value=Null)
      if name.respond_to? :to_str
        vb = VarBind.new(oid(name), value)
      else
        vb = name.to_varbind
        vb.value = value
      end
      vb
    end
773614
public static void initialize(SingletonProvider instance) {
        synchronized (SingletonProvider.class) {
            if (INSTANCE == null) {
                INSTANCE = instance;
            } else {
                throw new RuntimeException("SingletonProvider is already initialized with " + INSTANCE);
            }
        }
    }
400278
protected Variable createVariable(final String name, final Class<?> type,
            final Object value, final Modifiers mods) throws UtilEvalError {
        return new Variable(name, type, value, mods);
    }
617540
private LocalVariableDefinition constructStructInstance(MethodDefinition read, Map<Short, LocalVariableDefinition> structData)
    {
        LocalVariableDefinition instance = read.addLocalVariable(structType, "instance");

        // create the new instance (or builder)
        if (metadata.getBuilderClass() == null) {
            read.newObject(structType).dup();
        }
        else {
            read.newObject(metadata.getBuilderClass()).dup();
        }

        // invoke constructor
        ThriftConstructorInjection constructor = metadata.getConstructorInjection().get();
        // push parameters on stack
        for (ThriftParameterInjection parameter : constructor.getParameters()) {
            read.loadVariable(structData.get(parameter.getId()));
        }
        // invoke constructor
        read.invokeConstructor(constructor.getConstructor())
                .storeVariable(instance);
        return instance;
    }
711188
void setInstanceId(String instanceId) throws IllegalArgumentException {
        if (instanceId != null && !"".equals(instanceId)) {

            subInstanceId = getSubProcessInstanceId(instanceId);

            try {
                long id = getProcessInstanceId(instanceId);
                mainInstanceId = id < 0 ? null : new Date(id);
            } catch (NumberFormatException nfe) {
                throw new IllegalArgumentException(getLocalizedString("LVM_ERROR_INSTANCEID"), nfe);
            }
        }
    }
695009
static public IVariableAssigner setInstance(final IVariableAssigner newInstance)
    {
        final IVariableAssigner previousAssigner = instance;
        instance = newInstance;
        return previousAssigner;
    }
1085265
protected void configureVariableInstanceQuery(VariableInstanceQueryImpl query) {
    configureQuery(query);

    if(query.getAuthCheck().isAuthorizationCheckEnabled()) {

      CompositePermissionCheck permissionCheck;
      if (isEnsureSpecificVariablePermission()) {
        permissionCheck = new PermissionCheckBuilder()
            .disjunctive()
            .atomicCheck(PROCESS_DEFINITION, "PROCDEF.KEY_", READ_INSTANCE_VARIABLE)
            .atomicCheck(TASK, "RES.TASK_ID_", READ_VARIABLE)
            .build();
      } else {
        permissionCheck = new PermissionCheckBuilder()
              .disjunctive()
              .atomicCheck(PROCESS_INSTANCE, "RES.PROC_INST_ID_", READ)
              .atomicCheck(PROCESS_DEFINITION, "PROCDEF.KEY_", READ_INSTANCE)
              .atomicCheck(TASK, "RES.TASK_ID_", READ)
              .build();
      }
        addPermissionCheck(query.getAuthCheck(), permissionCheck);
    }
  }
1162462
public function build(): SetVariableValueRequest
	{
		$instance = new SetVariableValueRequest();
		if ($this->scopeNumber === null) {
			throw new BuilderException('Property [scopeNumber] is required.');
		}
		$instance->scopeNumber = $this->scopeNumber;
		if ($this->variableName === null) {
			throw new BuilderException('Property [variableName] is required.');
		}
		$instance->variableName = $this->variableName;
		if ($this->newValue === null) {
			throw new BuilderException('Property [newValue] is required.');
		}
		$instance->newValue = $this->newValue;
		if ($this->callFrameId === null) {
			throw new BuilderException('Property [callFrameId] is required.');
		}
		$instance->callFrameId = $this->callFrameId;
		return $instance;
	}
891058
def write_data(self,variable_id, value, task):
        
        variable = self._variables[variable_id]
        if task.property_name != '':
            # write the freq property to VariableProperty use that for later read
            vp = VariableProperty.objects.update_or_create_property(variable=variable, name=task.property_name.upper(),
                                                        value=value, value_class='FLOAT64')
            return True
        if variable.visavariable.variable_type == 0:  # configuration
            # only write to configuration variables
            pass
        else:
            return False