Let's say I read one object using Read data step and I choose to only read columns First name and Last name. How do I reference that data in Script task? I know I can copy those strings from step parameters to process parameters using Formula step but maybe there is a better way.

Like 0

Like

15 comments

Dear Carlos,

For the [Script-task] elements and methods that have the [For an interpreted process] checkbox selected, the wrapper class is generated that contains the initialization and declaration of methods. This wrapper enables you to access the process values. 

The Get method returns the value of an item or process.

Method signature:

Get<T>(string path)

where:

  • T — parameter value type.
  • path — a string that specifies the path to a parameter or property. The path is built according to these rules:
  1. “parameter name”
  2. “property name”
  3. “element name.parameter name”
  4. “element name.property name”

Oliver

Oliver,

I don't see a parameter First name though. The only related parameter that I see is Columns to read.

Carlos Zaldivar Batista,

You don't need any parameters and select any specific columns to read in the element Read Data, simply use “element name.property name” to get the field value in the Script task.

Oliver

Oleh Chudiiovych,

Ok, so I have a step with code ReadSomeData and I try to read the columns of returned object like this:

Get&lt;Entity&gt;("ReadSomeData.ResultEntity").GetTypedColumnValue&lt;string&gt;("UsrFirstName")

I get NullReferenceException though because the Get method returned null.

Try read data from all columns. Also possible for your query (filter) no records? Do it work if you remove the filter

Grigoriy,

I read data from all columns and the query returns records.

Dear Carlos,

As far as we can see from your method you are trying to read values from the "UsrFirstName" column and we don't know what data is stored there and what are you trying to read. Please re-check all your columns and also try Grigoriy's suggestion about filters.

Oscar

Ok, so I created a new trial environment with default test data and in that environment I created a process:

 

The Read data step looks like this:

I set up the step name too:

And that is my Script task code:

Name is a process parameter that is shown in the auto-generated screen. That's what the screen shows after running the process:

There are no filters in the read data step and the data is there. What should I change to make the script task work?

Hi by default read data have code "ReadDataUserTask1".

Try this:

var entity = Get<Entity>("ReadDataUserTask1.ResultEntity"); 

 

See read data advanced mode for get elenent code (

In the advanced mode, the element setup area contains additional parameters and connections with system records

To access the advanced mode, click the btn_advanced_mode.png button in the element setup area and select the [Advanced mode] menu command

)

Sory. For interpretable processes, you can only directly work with the methods and parameters of the elements through the formula.

In autogenerate page set page item via formula like:

[#Read data 1.First item of resulting collection.First name#] 

Grigoriy,

Thank you. And is it possible to use this formula in a script tasks?

Yes

1. Create a process parameter of type String - TestParam.

2. In the parameter value specify [#Read data 1.First item of the resulting collectionFirst name#].

3. In the Task-script element, work with the parameter.

     var contactFullName = Get<string> ("TestParam");

Grigoriy,

Ok, thank you.

Does anyone know if this is still the case? i.e. that it's necessary to save each individual field to a parameter in order to access them inside a Script Task element of a Business Process? It seems like it really should be simpler to access data on any of the fields!

 

I am aware of being able to query the entity directly within the Script Task, but I'd like to keep as much of the business logic in easy-to-read BP steps as possible, including reading data.

Dear Harvey,

 

Yes, the logic remains the same. There is still to call for read data element through the script task without the intermediate process parameters or settings. This logic will be review by our developers, it is confirmed by our R&D but we do not know when it will be done.

 

Regards,

Dean

 

Show all comments

Hi Sir/Madam,

Onload function is not working, request you to please check the below code

define("UsrPersonalDetails1Page", ["jQuery"], function(jQuery) {

   return {

        methods: {            

            onload: function() {

                    $(".control-width-15").hide();

            }

      }

 }

}

Regards

Raghu Ram

Like 0

Like

3 comments

Bpm'online uses ext.js framework's mvvm pattern. Additionally, the system converts code from pages into viewmodels using generators (for example SchemaBuilderV2 (getSchema method) and  ViewModelGeneratorV2) The error was in the fact that you tried to add jquery function into a config for a generator. The config was not connected to a page directly. Technically it's possible to perform something like 

define("AccountPageV2", ["jQuery"], function() {
	return {
		entitySchemaName: "Account",
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
		methods: {
			onEntityInitialized: function() {
				this.callParent(arguments);
				$("#ProfileContainer")[0].style.backgroundColor = "blue";
			}
		},
		rules: {},
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/
	};
});

but it's very incorrect. Please don't do that.

Please investigate the bpm'online documentation and use out-of-the-box tools that allow creating needed business logic.

Eugene Podkovka,

Hi Sir/Madam,

In the below code I have called init and render but it's not working. Request you to please check.

define("UsrClientDetails1Page", ["jQuery"], function(jQuery) {

    return {

        entitySchemaName: "UsrClientDetails",

        attributes: {},

        modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,

        details: /**SCHEMA_DETAILS*/{

            "Files": {

                "schemaName": "FileDetailV2",

                "entitySchemaName": "UsrClientDetailsFile",

                "filter": {

                    "masterColumn": "Id",

                    "detailColumn": "UsrClientDetails"

                }

            }

        }/**SCHEMA_DETAILS*/,

        businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,

        methods: {

            init: function(callback) {

                setTimeout(callback, 2000);

            },

            render: function(renderTo) {

                $(".grid-layout-column").hide();

            }

        }

    };

});

Regards

Raghu Ram

 

Raghu Ram,

- setTimeout(callback, 2000);

It's not correct to stop all application for some time. Please find other solution.

 - init: function(callback) {

- render: function(renderTo) {

init and render are not asynchronous functions. Please use this.callParent(arguments) instead. Something like

onEntityInitialized: function() {
    this.callParent(arguments);
}

-  $(".grid-layout-column").hide();

jQuery is always a bad solution in case of hiding things. If you need to hide an element that can't be hided by a business rule, please consider using CSS. You can find an example in the article by the link below. 

https://community.bpmonline.com/questions/how-add-custom-style-control-…

 

 

Show all comments

Hi community!

How are you?

How can I add a new action to dashboard panel on Contact? I want add a button that show some contact information by default when open the edit contact page

I attach image below

Like 0

Like

1 comments

Dear Ezequiel,

 

Unfortunately, there is no functionality that would allow you to customize the action dashboard buttons without the additional development in the current version of the system. We have the suggestion registered and passed to R&D team already and it will appear in one of the further releases of the system (no ETA yet).

If you need the additional button in the current system version, feel free to inspect the page and find the code responsible for the out-of-the-box buttons. Then you can use it as an example for your own development.

Lisa

Show all comments

I would like to get rid of tag button on all my pages. Is it possible to use replacing client modules to remove TagUtilitiesV2 from the list of dependencies of BasePageV2? Or maybe there's a better way to do that?

Like 0

Like

2 comments

You can write something like the code below in the BaseModulePageV2 and in the BaseSectionV2

define("AccountSectionV2", [], function() {
	return {
		entitySchemaName: "Account",
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		attributes: {
			"UseTagModule": {
				dataValueType: Terrasoft.DataValueType.BOOLEAN,
				value: false
			}
		},
		methods: {},
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

 

Thank you very much.

Show all comments

I added an entity inheriting from Base lookup,  let's call it Registration status. Then I added a new lookup in Studio->Lookups - Registration statuses and from this interface I added two status instances - Registered and Unregistered. Then I wanted to translate the lookup name and the names of the statuses. I added appropriate records to tables SysLookupLcz and SysUsrRegistrationStatusLcz.

Now I want to save the rows from these tables in a Data package, so that they get saved in our code repository but I cannot find the tables in the drop down. I know that there's another table called Translation and that the translated strings that I created are there but the table has tens of thousands of rows and it's difficult to find my strings there. What should I do? Is it possible to save rows from tables SysLookupLcz and SysUsrRegistrationStatusLcz directly or do I have to save, carefully filtered, data from the Translation table?

Like 0

Like

1 comments

Never mind, I haven't realized that the translations get saved automatically when you save data from the base table (UsrRegistrationStatus and Lookup in my case). I'm leaving the question in case someone else searches for that topic.

Show all comments

Hi Sir/Madam,

Please tell me how to add HTML code in a page? 

Regards

Raghu Ram

Like 0

Like

1 comments

Hello,

We do not recommend to insert custom HTML code to the pages. You can use onEntityInitialized method to get the links to the parts of the page with the help of the base system JavaScript. Once you get the code of the necessary parts of the page, you will be able to alter it according to your business task.

Lisa

Show all comments

Dear Team,

                  How to get Nested Parameter value in section wizard. i trying to get value from web service using process designer how to set formula value.see below

 

Thanks in advance,

Sekhar.

 

Like 0

Like

1 comments

Dear Sekhar,

Based on the screenshot, I can assume, that you are receiving an array in the JSON response, which you want to use further in the formula. Therefore, since this is an array and you want to pass it to the text field, you need to transform it to the single string. Here you can choose two options:

1. Use String.Join method in the Formula to unite array elements. https://msdn.microsoft.com/en-us/library/57a79xd0%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

See the example of method usage in Formula:

String.Join(", ", [#MyParameter#])

2. Adding a Script Task element, where you will run a ForEach method to work with an array. The result can be passed to the process parameter and used further.

Regards,

Anastasia

Show all comments

Hi;

I create the page and want change the order of get focus of elements

I change the value of index attribute of elements but it has no influence for page behavior

also i add tabindex value with no effect.

That is example of an element diff array

            {

                "operation": "insert",

                "name": "STRING0b13ddcf-317e-4952-87eb-7051a1088698",

                "values": {

                    "layout": {

                        "colSpan": 9,

                        "rowSpan": 1,

                        "column": 0,

                        "row": 1,

                        "layoutName": "Header"

                    },

                   "bindTo": "UsrFirstName",

                   "tabindex": 1, 

                    "enabled": true,

                    "labelConfig": {

                        "caption": {

                            "bindTo": "Resources.Strings.STRING0b13ddcf317e495287eb7051a1088698LabelCaption"

                        }

                    }

                },

                "parentName": "Header",

                "propertyName": "items",

                "index": 2

            },

Like 0

Like

2 comments

Dear Tomasz,

Unfortunately, there isn't currently a way to set tabindex attribute through the diff section. We will register this in our backlog. 

Though, you can manipulate DOM elements using standard JavaScript methods, like setAttribute()

https://www.w3schools.com/jsref/met_element_setattribute.asp

Regards,

Anastasia

 

 

Anastasia Botezat,

 Thanks

Show all comments

Hi;

Is it posible to add custom validation not connecting with any page but just run on page validation on Pre_configured page

Like 0

Like

4 comments

Hello,

Please describe the filter more precisely. Where it should work if it doesn't lie on a page. 

Hi;



When i have a condition base on many elements when I join it to one element it return error ena then when any other validation appear i got the message about wrong validation.

I would like to run validation just at the quiting the page and not asign it to any element

tomasz.branicki,

I'd write something like 

methods: {
			onTestClick: function() {},
			myValidation: function(callback, scope) {
				var resultObject = {
					success: false
				};
				callback.call(scope, [resultObject]);
			},
			asyncValidate: function(callback, scope) {
				this.callParent([function(result) {
					if (result.success) {
						this.myValidation(callback, scope);
					} else {
						callback.call(scope, result);
					}
				}, this]);
			}
		},

 

Eugene Podkovka,

 THANKS

 

Show all comments

Hi Sir/Madam,

Please tell me how to call jQuery plugins from Page.

Regards

Raghu Ram

Like 0

Like

1 comments

Dear Raghu,

There is no simple possibility to call jQuery plugins. You need to create a module in a bpmonline and copy/paste code from a plugin to the module. Then add this module to the dependencies list how is described here

 

Show all comments