Camunda: find process instance by variable value - bpmn

Can I find a process instance by a process instance variable value via the Camunda REST API as described in this request:
https://groups.google.com/forum/#!topic/camunda-bpm-dev/gJfXkbkY8fc
(the question above is from 2014, maybe there is a standard way now?)

Looks like this is supported now:
GET /process-instance
variables: Only include process instances that have variables with certain values. Variable filtering expressions are comma-separated and are structured as follows:
A valid parameter value has the form key_operator_value. key is the variable name, operator is the comparison operator to be used and value the variable value.
There is also a POST endpoint which allows to express the filtering more cleanly:
POST /process-instance
variables: A JSON array to only include process instances that have variables with certain values.
The array consists of objects with the three properties name, operator and value. name (String) is the variable name, operator (String) is the comparison operator to be used and value the variable value.

Related

How can I perform a regex/text search on a SUPER type?

What I'm doing now:
I have a table with one field that is a json value that is stored as a super type in my staging schema.
the field containing the json is called elements
In my clean table, I typecast this field to VARCHAR in order to search it and use string functions
I want to search for the string net within that json in order to determine the key/value that I want to use for my filter
I tried the following:
select
elements
, elements_raw
from clean.events
where 1=1
and lower(elements) like '%net%'
or strpos(elements,'net')
My output
When running the above query, I keep getting an empty set returned.
My issue
I tried running the above code and using the elements_raw value instead but I got an issue :ERROR: function strpos(super, "unknown") does not exist Hint: No function matches the given name and argument types. You may need to add explicit type casts.
I checked the redshift super page and it doesn't list any specifics on searching strings within super types
Desired result:
Perform string operations on super field
Cast super field to a string type
There are some super related idiosyncrasies that are being run into here:
You cannot change the type of a super field via :: or cast()
String functions like and strpos do not work on super types
To address both of these issues, you can use the function json_serialize to return your super as a string.

What are anonymous variables?

A program variable is an abstraction of a computer memory cell or collection
of cells. Programmers often think of variable names as names for memory locations, but there is much more to a variable than just a name.
In this case, what is an anonymous variable?
What does the below statement mean?
Variables without names are called anonymous variables.
Can you provide language specific examples for the same?
In C++, reference variable to const can be initialized by constant.
In this point, temporary variable is created in memory to grab the constant.
const int &ref = 3;
like this. so we can call this temporary variable to "anonymous variable".
Variables are where you store you values. 'Variable Name' is the usually the easiest (and more human-like) way to locate your value.For example, if I am a variable, you can get my value by calling my name, and the combination of my value and my name is called 'variable'.
However, not all variables need a name.Sometimes you just use them once and don't need them anymore; and in that case, a name is unnecessary.
The example given by #BAE HA RAM is a telling one,in which case you don't need a name for the value but ref to it by a pointer(But still got a name for that pointer)..
There are also many other anonymous things, anonymous type, anonymous function and so on. Most of them are created to avoid too many meaningless names for the things that you only need to run once.
I'd like to know which language you are using, so more specific example can be given...

Difference between values and literals

What's the difference between values and literals? Values apparently have dynamic type, and literals apparently have static type, according to slide four of the first page in Here. But isn't a literal a value?
Using the terms used in that slideshow - a literal is kind of container, so it'll be better to compare between values and containers.
A container "contains" a value. If you write int x=1;, then x is a container and the number one is a value. But 1 is also a container - more precisely, a literal. The slideshow stress that there is a difference between the value one and the literal 1.
When you code, you can't actually access values directly - you can only do it via containers. That's why you can write x and 1, but not the value that is the number one.
A literal is a container that can be translated directly to a value without looking at it's surrounding - for example 1 can be translated directly to the number one. x can not be translated to a value in such a way, since it's a variable and we don't know what it holds unless we look at the surrounding code.
As for the dynamic vs static types - a container has a static type, known at compile-time. If it's a variable, it's the declared type of the variable. If it's an expression, it's the inferred type of the expression. If it's a literal, it's the direct type of the literal. The compiler can tell the type of each container without running the program and without caring what values it'll hold once the program runs.
A value, on the other hand, is stored in memory as a series of bytes. The type data is also stored in memory near the value(unless it's a primitive value), that's why the types of values are dynamic - because if you want to discover what type a value has, you have to look in the memory during runtime.
Even though values' types are dynamic, Java is a static language since you usually don't look at the dynamic type. Since you can only refer a value via a container, the static type of the container is used when you do things with the value.

Difference between using GetterUtils and ParamUtils

For instance, when to use
GetterUtil.getBoolean()
and when
ParamUtil.getBoolean()?
Are both same, or is it expected to be used differently according to a parameter, a variable, etc? Can you give some examples for both?
Both are util methods to avoid Null-Pointer Exceptions.
GetterUtil internally returns the default type and does the casting too. So in case where someone has passed a null value, it will return default value of the type.
Example:
Assume you have a String value "true", and you are expecting it will always be of type boolean. So you use GetterUtil.getBoolean("true") which will internally do the casting to boolen and return the value as boolean-true. Incase someone passes rubbish characters like "tr", it will be converted to boolean-false.
As mentioned ParamUtil does the same treatment with request parameters. ParamUtil internally uses the GetterUtil to have the above behaviour. It first retrieves the parameter (which always would be a string) and then passes it to GetterUtil.getType() method and in turn returns the proper type.
GetterUtil and ParmUtil both are different classes.
GetterUtil is to get the default values for basic Java data types.
ParamUtil is to retrive the values(of primitive data types) from the HttpReqeust.
Check the source code here for these two classes here
For GetterUtil
http://docs.liferay.com/portal/6.0/javadocs/src-html/com/liferay/portal/kernel/util/GetterUtil.html
For ParamUtil
http://docs.liferay.com/portal/5.1/javadocs/portal-kernel/com/liferay/portal/kernel/util/ParamUtil.java.html

What is the definition of ":=" in vb

I came across some sample code in VB.Net which I have some experience with and kinda having a duh moment figuring out the meaning of :=.
RefreshNavigationImages(bForward:=True, startIndex:=-1)
The sig for this method is RefreshNavigationImages(boolean, int). Is this a default value if null? Like "bIsSomething ?? false"?
Tried to bing/google but they just don't like searching for operators especially if it's only 2 chars.
They are named parameters. They let you specify values for arguments in function calls by name rather than order.
The := indicates the use of named parameters. Rather than relying on the order of the parameters in the method declaration, named parameters allow you to specify the correlation of parameters to values by specifying the name of the parameter.