Activiti Workflow : How to display variable instances values - spring

So I'm working on activiti and I'm wondering how to retrieve variable instances from act_hi_varinst table:
this is the table:
I want to retrieve the TXT_ value and PROC_INST_ID_ value and UPDATED / CREATE time value.
Is there is a way to do this ?

Related

How to set dynamic default parameter values for datetime picker in amazon quicksight?

I just want to set dynamic default values for datetime control in amazon quicksight.
Just like startDate (last 7 date) and endDate (today date).
In quicksight, is that possible?
In aws document says that Calculated fields can't be used as dynamic defaults. So, how I can achieve this kind of simple thing in quicksight?
Appreciate for any advise.
This is a very tricky situation to handle.
Amazon QuickSight does not support using calculated fields as filters, so you cannot add the value you calculated as the default value for a parameter.
Normally you would have three options:
Add the desired value as a column (let's say new_date) in your dataset and update it with every refresh (so when you refresh the dataset that column would be calculated again), then use new_date as the default value for your parameter
Update the value manually (QuickSight GUI)
Update the value from CLI or Boto3
The first option would be working if Amazon QuickSight supported dynamic defaults for date values. But it does not. So you have only two options: either update it manually or update the value using CLI or Boto3.
The way I overcame it is, I created a Lambda function that updates the 2 date values in my dashboard.
First you need to use UpdateDashboard to update the dashboard parameters, then you need to use UpdateDashboardPublishedVersion to update the published version of the dashboard.
You can do it using a bash script and AWS CLI, or using Lambda functions and Boto3.

Setting default value as custom sequence

Question regarding the declaration of primary key with default value.
Using cockroachDB, we can create sequence to basically have ID starting from 1, with regular increment of 1.
create sequence for cockroachdb
Trying to create my model with default value nextval('sequence_name')
`gorm:"DEFAULT:nextval('sequence_name')"`
Tried this one above, but it's not working (edited)

SQL: Update fields based on another fields information

I am trying to automate an UPDATE query based off one columns data and apply that same field to another.
See screenshot:
In this, what I am trying to do is update PCODE from a value of 0 to that of the value shown in SI_PCODE. This would need to be updated by the unique variable of the SALES_QUOTE_ID. I currently do this manually with excel using
update sales_quote_contact set pcode= where sales_quote_id=;
but want to run this automatically through a batch job I have.

Running parallel jobs in talend

I have a situation where i need to run five different child jobs in talend in parallel. Problem is that, in my select query i would be getting five different ID's and then for each particular id , i need to run five different jobs. Problem with tparrallelize component is that , it does not allow me to pass context variables to each sub job, i.e id in this particular case.
select id from table limit 5; ----> five different instance of same job with different id as parameter
Any help would be highly appreciated
thanks
I'm not sure if I properly understand what you're doing here but if you were to break out each of those IDs and store them as 5 separate context variables then each job could access their own context variable with the right ID stored for each of them and use that.
So I would start with your database input component (just select the IDs you want) and feed that into a tFlowToIterate. Connect this via an iterate flow into a tFixedFlowInput component and create 2 fields in your schema, "key" and "value". Use the inline table to specify that "key" should be ((Integer)globalMap.get("tFlowToIterate_1_CURRENT_ITERATION")) and "value" should be ((String)globalMap.get("row1.SupplierPartNumber")).
I'd then throw this into a tMap component where I'd put "ContextNumber" + row2.key into the mapped key column just to make it a bit more obvious than the iteration number as your context and then feed that directly into a tContextLoad.
From there you can OnSubjobOK to your tParallelize component and link all your jobs together. In each job configure the jobs to use the appropriate context variable.

making a global variable and incrementing in function - CodeIgniter

I'm trying to make a global variable in my model to increment an id field in my mysql table, but CI won't allow me to make global variables.
I've searched around and people are mentioning having to create a library and declaring the global variable there, and then loading the library in the model and using the variable.
I understand that approach, but how/where would I be able to increment the variables value so that the next time it's called in a function it will be +1?
Thank you in advance for any help
edit: the thing I'm trying to do is whenever I insert a new row in a table, I want to continue on from the last entries id number i.e. last id number in the table is 9, I want to increment on from that number and make the new rows id number 10
If you're able to access the database through CI you can use the Active Record count_all() function.
From CI docs http://ellislab.com/codeigniter/user-guide/database/active_record.html
Permits you to determine the number of rows in a particular table.
Submit the table name in the first parameter. Example:
echo $this->db->count_all('my_table');
// Produces an integer, like 25
You would just get the number of rows in the table returned and add 1 for the row in your new entry.

Resources