I'm creating a process that reads data and then needs to update a text column on that data by appending some new text to the existing string. I can read the data fine but the script task throws a null reference exception. Here is the simplified version of my script:

var programs = Get("ReadDataUserTask1.ResultEntityCollection");

foreach(var program in programs) {
    program.SetColumnValue("Campaign Flags", "Test");
}

return true;

The programs is null when I run the process.

Like 0

Like

7 comments

Dear Scott,

Try another approach to overcome the issue. Please read the collection of the Read Data in the following way: 

 var entities = Get<ICompositeObjectList<ICompositeObject>>("ReadDataUserTask1.ResultCompositeObjectList");

Afterwards proceed further with collection result.

Regards,

Anastasia

Anastasia Botezat,

using trying the above script, when I convert the list to string by doing:

entities.ToString());

I get  - Terrasoft.Common.CompositeObjectList`1[Terrasoft.Common.CompositeObject] (looks like the type and not the value)

Can you help?

Chani Karel,

 

There is no need to cast object to string since you can get the value from some column of the object using GetCompositeObjectColumnValue (in my case I was reading the "Full name" column value from the collection of contacts):

 

string name = GetCompositeObjectColumnValue<string>(contacts, "Name");

and then process the value according to your needs.

 

Best regards,

Oscar

Hi Chani Karel,

I think there are 2 things in your scripts:

1. You ReadDataUserTask1 result could be empty.

var programs = Get<EntityCollection>("ReadDataUserTask1.ResultEntityCollection");

Therefore, before the "foreach Loop", you really need to check if the programs is null or not. Otherwise, you might get the exception as you mentioned.

 

2. Please use the column code instead of column title to set value.

For example, in Contact there is column with code "JobTitle" and title "Full job title". If you need to set the value, you need to use the code "JobTitle".

 

regards,

 

Cheng Gong

Oscar Dylan,

using the tostring method was just to understand why I don't get the values as needed. 

What I need to do is this:

I get a list of 'contact in opportunity' by the read collection of records element. I need to get the contact as lookup  value and not as string (the Id and not name) in order to set parameters with the contacts and send email to them.

How do I do it?

Thank you.

Cheng Gong,

using the tostring method was just to understand why I don't get the values as needed. 

What I need to do is this:

I get a list of 'contact in opportunity' by the read collection of records element. I need to get the contact as lookup  value and not as string (the Id and not name) in order to set parameters with the contacts and send email to them.

How do I do it?

Thank you.

Chani Karel,

How did you end up solving this?

 

Kind regards,

Yosef

Show all comments
7.12
studio

Hi;

I create new Section entity by wizard;

The notes field on page doesn't keep the values after save.

Anyone can help

Regards

Tomek

Like 0

Like

1 comments

Dear Tomek,

Can you please specify how did you add this field on a page? And are you referring to attachments and notes detail or you added HTML box? Can you share a screenshot of this field? 

Show all comments

Is it possible for race conditions to appear when using signals? For example, let's say I have a process A that creates an object. There's also a process B that gets called when object of this type is created and it sets the object status to some value. In its next step process A checks this status.

Will all those actions always appear in the same order or is it possible that sometimes process B will change the object status before the check in the process A and sometimes it will do that after the check?

Like 0

Like

2 comments

Dear Carlos,

Usually, task like those are solved with the help of timers and/or subprocesses. You can add wait timer after process A creating an object and after process B modifies it so the processes will have time to complete. You can aslo test the time it takes for both process to complete to adjust timers accordingly. If the processes check/modify the same object but they are not connected it is completely possible that process A might check the status before it was changed by B.

Ok, thank you for the information.

Show all comments
7.12
studio

Is it possible to force update of database tables with records from data packages? I would like make my database to reflect what is in data packages for tables that have data packages associated with them.

Like 0

Like

5 comments

Set instalation type = Update existing and check column [Forced update]

[Update existing] - when updating a package, only those object columns that are marked with [Required for update] ([Forced update]) in the [Columns] group will be updated. This type of installation is used, for example, when delivering hotfix updates!

And how can I automatically delete records that are not in the data package? Let's say I have a list of car models and this list has changed completely. I delete old records and add new ones on my development environment. Then I update my data package that stores car models. Now I want my changes to appear in the testing environments but while the new records are added as expected, the old car models are not deleted.

For these purposes, create a sql script and set the database type and installation type. (For examples see DeleteAllSettingsFolderMSSql from UIv2 in configuration tab Sql scripts)

Grigoriy,

Hi Grigoriy,

Is it possible for the sql script to run automatically? or do I need to run it?

Thanks,

Raz

Hello Raz,

 

If I understood your question correctly, we'd suggest running the needed scripts manually but also you can try to create SQL triggers for starting those scripts automatically.

 

Best regards,

Roman

Show all comments

how can I write data received

from an external webservice in

the contact table

using a business process?

 

 

Like 0

Like

4 comments

Hello Stefano,

For such purpose, you need to create a script task. In the Script task you need to get the response from your web-service, deserialize it and set the deserialized values as a business process parameters. After that you will be able to modify your Contact object with the business process parameters.

Please, see an example how you can obtain a response from the web-service and deserialize it in the Script task:

string response = Get<string>("WebService1.Response");

var resCollection = System.Web.Helpers.Json.Decode(response);

Please, note that you need to add the System.Web.Helpers library to the External Assemblies of your package in the Configuration.

Hello Tetiana,

Thank you for your response.

The sample above (you can find it at https://academy.bpmonline.com/documents/technic-bpms/7-12/call-web-serv… a business process that uses "Call web service" action but it's not documented how the "Log in to bpm'online" and "Insert contact bpm'online" is done.

Do you know how to make it?

I believe the mentioned article is not about the business-process "Get contacts from third-party database". It is just an example how to work with the 'Call web-service' element. Therefore, it doesn't cover all process elements.

If you need to get the contacts from the external web-service, the algorithm is the next:

- Create a web-service and specify all its methods and response paramaters. You can use this guide as an example - https://academy.bpmonline.com/documents/technic-bpms/7-12/calling-web-s…

- Create a business process with [Call web-service] element

- Create a script task to parse your response data. 

As an alternative, you can specify all your web-service response parameters, following this guide - https://academy.bpmonline.com/documents/technic-bpms/7-12/setting-parsi…

- Than you need to insert the parsed response parameters to the contact table via [Add data] business process element. Please, see the 'Working with web service response' part of the guide (https://academy.bpmonline.com/documents/technic-bpms/7-12/call-web-serv…). In your case, you need to use [Add data] element instead of the [Pre-configured page]

Hi Tetiana

I found the solution.

  • Create a web-service and specify all its methods and response paramaters:  I captured with "fiddler tool" the json request and the json response for Login to Bpm-online and the json request and the json response for Insert a new contact
  •  Create a business process with [Call web-service] element: using quick setup and the json mentioned above I configured the [Call web-service] element
Show all comments
7.12
studio

In the documentation for message start event, it states:  "as well as object or page event. For example, when you click a button or open a right-click menu, a corresponding message is sent to the process of the corresponding object or page."

Can anyone show an example in the product where this is implemented?

Like 0

Like

4 comments

Open [Process library] section list Here you will find many examples

The section folder tree is displayed in the [Process library] section b default. In addition to standard folders, the tree contains folders that are generated automatically, based on the processes currently available in the library.

All standard folder functions are available in the [Process library] section.

By default, the folders in the [Process library] section contain folders that group the processes by the type of their starting event. These folders have unique icons to visually distinguish them from regular folders. These folders cannot be edited.

The folders that group business processes by the type of their starting events are displayed only if corresponding processes exist in the library.

These folders also have automatically generated subordinate folders that further group the processes by their starting event parameters:

In the “Run by object signal” folder, further grouping is done by objects that trigger processes (Fig. 3).

In the “Run by timer” folder, further grouping is done by the timer settings.

Grigoriy,

I was asking about Message Start Event, not Signal.  I have not been able to find any example in the product where it is used.  I am quite comfortable with Signal and Timer start events, and have used message start events in other products.  i would like to understand better how they can be used in bpm'online.

Message Start Event used in many event subprocesses of objects (Practically in every subprocess of an object they are used. Event processing is implemented on them just inside objects). For example, open the Activity object. from Base Package and go to the additional / open process

Thanks

Show all comments
list
lookup
7.12
studio

 

Hello community!

How are you?

I have a lookup that is displayed in the "List" mode,

I need to add / remove values ​​from this list dynamically based on the value of another field.

The same value in the list can be displayed for more than one value in this last field.

How can I do that?

Regards

 

Like 0

Like

5 comments

Dear Raul,

This target can be achieved with the help of the business process that will add data to the field if another field is filled in with some data.

For example you need to insert value "1" in the "List" lookup when the value of field "Field" is modified to "2". In this case you should create a business process with "Signal" start element which will be triggered if the field "Field" is changed to value "2". After that there should be "Read data" element which should read the object where the "List" lookup is present. Then "Add data" element should go which will add data to "List" lookup and you can also specify that you need to add value "1" there.

Another issue: you need to add data to the "List" if the added record has been added with the specific value of "Field". In this case the business process is similar to the previous except of the start signal: it should be "Signal" -> "Record added" and after that you should add "Read data" and "Modify data" elements.

As a result you will have your list filled in automatically with new data or existing data based on the value of another field. You can also read more about business process deign in the academy article here.

Best regards,

Oscar

Dear Oscar,

I expressed wrong.

I have two type list fields

 

 

 

 

 

 

The field named "Contexto Sospecha", should filter  its values in base to "Tipo Sospecha Vulneracion" field value. But it is not a simple FILTRATION BUSINESS RULE. A same value of "Contexto Sospecha" field can belong to more than one value of the other field. Is a N to N relation. I create a table with the relation of both fields, 

How can i filter the values based on that table

i tried to configure filters but I was not succesful

Any idea?

Regards,

Ezequiel

Maybe an article from the academy "Using filtration for lookup fields. Examples" will help you.

You can also use the business rule filtering (without programming using the wizard)

Hello!

The above-mentioned articles

( https://academy.bpmonline.com/documents/technic-sdk/7-13/using-filtrati…

https://academy.bpmonline.com/documents/technic-sdk/7-12/filtration-rul… )

should indeed help you out with achieving your task.

Best regards,

Matt

Show all comments
7.12
studio

I'm trying to translate a custom section named Reports and failing so far. I used the translation page, searched for untranslated strings with the English name Reports and translated them. I also manually updated SysModuleLcz to put my translated name there. The sections still only displays its English name. Do you know what should I do to fix it?

Like 0

Like

2 comments

Hi! Can you please send more detailed description (link to the instance ect) on support@bpmonline.com so we could investigate this? 

Ok, never mind. It seems I had to restart the server for the changes to show.

Show all comments

I'm trying to insert a custom button on a section page my code looks like that:

{
	"operation": "insert",
	"name": "DailyReportButton",
	"parentName": "SeparateModeActionButtonsLeftContainer",
	"propertyName": "items",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"style": Terrasoft.controls.ButtonEnums.style.BLUE,
		"caption": {"bindTo": "Resources.Strings.DailyReport"},
		"click": {"bindTo": "generateDailyReport"},
		"classes": {
			"textClass": ["actions-button-margin-right"],
			"wrapperClass": ["actions-button-margin-right"]
		},
	}
}

It works but I don't know how to specify exactly where the button should be placed. In this case I want it to be between New and Actions buttons. I tried experimenting with setting values.index but it didn't seem to change anything. Do you know how to do that?

Like 0

Like

1 comments

Dear Carlos,

You can find detailed description on our Academy. You will need this part: 

                    // Setting the location of the button.
                    "layout": {
                        "column": 1,
                        "row": 6,
                        "colSpan": 1
                    }
                }
 
Show all comments
report
7.12
studio

Someone tried to connect third-party report generators such as FastReport ro StimulSoft?

Like 0

Like

1 comments