bpm'online community,

I added a new source code that needs System.Net.Http. When I try to publish it, I get these errors:

The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)

The type or namespace name 'HttpClient' could not be found (are you missing a using directive or an assembly reference?)

In the Autogenerated code I see the reference to System.Net.Http and if I view it on the Object Browser I see the HttpClient class.

I'm on Version 7.12.0.2656 of bpm'online studio.

Any ideas on what is causing the compile error?

Thanks,

Jose

 

using System;

using System.Text;

using System.Threading;

using System.Threading.Tasks;

using System.IO;

using System.Net.Http;

namespace Terrasoft.Configuration

{

    public static class UsrDownloadImageHelper {

        

        private static readonly UsrLimitedPool httpClientPool =

          new UsrLimitedPool(() => new HttpClient(), client => client.Dispose());

          

        public static async Task DownloadImageFromUcm(string imageId, string pathToSave, CancellationToken cancellationToken)

        {

....

}

Like 1

Like

1 comments

How you resolved this issue? I am facing with the same type of error "The type or namespace name 'Json' does not exist in the namespace 'System.Text' (are you missing an assembly reference?)"

Show all comments

Hi,

I'm trying to call a bp from a webservice that doesn't use authentication so i'm following the example provided: 

https://community.bpmonline.com/articles/web-service-without-authorizat…

When i try to set the parameter of the  business process i get the following error: 

Terrasoft.Common.InvalidObjectStateException: missing property "UsrNewInsertedEntityId" of type "ProcessComponentSet"
var UserConnection = this.SystemUserConnection;
var manager = UserConnection.ProcessSchemaManager;
var processSchema = manager.GetInstanceByName("UsrIncomingEntity");
var process = processSchema.CreateProcess(UserConnection);
if (processSchema.Parameters.ExistsByName("usrNewInsertedEntityId"))
{
    process.SetPropertyValue("UsrNewInsertedEntityId", msgId);
}
process.Execute(UserConnection);

Do i need to set anything on the BP process property?

Like 1

Like

8 comments

Hi Luciano, 

Please advise if you created your UsrIncomingEntity business process beforehand and if you added the usrNewInsertedEntityId parameter into it. Make sure you do that first.

If you did it, kindly provide us with the whole code so that we could have a look into it and advise on possible errors.

Thanks

Hello Luciano,



Basically, the code should work in appropriate way. As S.Kobizka said, you should check that business process with code "UsrIncomingEntity" exists and has  "usrNewInsertedEntityId" parameter. 



Also, I recommend try to choose "compile all" option in configuration, it may help because source code will be regenerated.



If you will have further difficulties, please, send the entire code of webservice and screenshots of the businessprocess.



Regards,

Alex

Alex_Tim,

Hi,

Thank you both for the answer, the BP exists prior to the webservice as well as the parameter. If i debug the code both the bp and the parameter are available to inspect. As soon as the line:

process.SetPropertyValue("UsrNewInsertedEntityId", msgId);

is executed i get the error.

I'll try the compile all option and then retest to  see if that helps.

Thanks

Luciano De Munno,

 

It seems that the reason of the issue is that msgId variable and UsrNewInsertedEntityId parameter in business process have different types. Please make sure that msgId is Guid and UsrNewInsertedEntityId is unique identifier http://prntscr.com/n0yt77



Regards,

Alex

Alex_Tim,

Hi Alex,

Thank you for the answer, i checked and msgId is a Guid and the parameter UsrNewInsertedEntityId has the type "Unique Identifier". AS far as i know that's the correct type i can try chaning both the string and text and then converting to guid inside the process to see if that helps.

Same thing, now i'm sending a string and expecting a string but the error is the same. 

Hello Luciano,



Here is the example of how to start business process with parameter from server side code.

If you will have further difficulties, please contact support team support@bpmonline.com





using Terrasoft.Core;

using Terrasoft.Core.Process;

using Terrasoft.Core.Process.Configuration;

 

ProcessSchema schema = UserConnection.ProcessSchemaManager.GetInstanceByName("LeadManagement");

//schema = UserConnection.ProcessSchemaManager.GetInstanceByUId(leadManagementProcessUId);

 

//different engines for interpretable and compiled BP

bool canUseFlowEngine = ProcessSchemaManager.GetCanUseFlowEngine(UserConnection, schema);

if(canUseFlowEngine) {

    var flowEngine = new FlowEngine(UserConnection);

    var param = new Dictionary<string, string>();

    param["LeadId"] = Entity.Id.ToString();

    flowEngine.RunProcess(schema, param);

} else {

    Process process = schema.CreateProcess(UserConnection);

    process.SetPropertyValue("LeadId", Entity.Id);

    process.Execute(UserConnection);

}        

Hi Alex,

The FlowEngine part did the trick. Thank you so much

Show all comments

Hi,

In bpmonline we can generate leads landing page code to be included in html of website page and its working fine.

Is there any code available for IOS and Android is available for the same usage?

 

Regards

Like 0

Like

1 comments

Dear Muhammad,

If mobile users use browser and HTML of your page is can be viewed in mobile browser, code should work as well. 

Best regards,

Angela

Show all comments

Hi Community,

Any  idea how i can display the approval on each record on Section Page, in this way there is no need to open each record, approved it and go back again to section wizard.

Like 0

Like

3 comments

Dear Fulgen,

As far as I understood you - you need to create a test approval record in each section on each record. First of all you need to activate approvals for this section in section wizard. After it is done - there will be a table created in the database called "Object_name"Visa. For example it will be OrderVisa for orders, InvoiceVisa for invoices and so on. After that you will be able to create test approval records for each section using Insert query. Please take a look at the table and see which columns you need to specify (status of visa can be got from VisaStatus table).

Best regards,

Oscar

Oscar Dylan,

Hi Oscar, thanks for your reply

Currently we already have approval on our Section, but this is only available in edit page when you open a specific record. Is there a way to show it on each record in section page,

Fulgen Ninofranco,

Approvals tab and detail sholuld be present on each record of the section and in "Actions" you have "Send for approval action" and clicking on this action you will be able to add a record in this detail. If you don't see this detail for some records then it seems that you have a business rule or some code that prevents this detail from appearing on the page. Please review all rules and the code of the page.

Best regards,

Oscar

Show all comments

Hi Community,

Any idea how can I override the Open section record button and the Name Link on section?

 

Like 0

Like

1 comments

Hi Fulgen, 

You can try overriding the button in the diff section:

diff: /**SCHEMA_DIFF*/[
            {
                // values from parent, replacing and replaced schemes merge together,
                // the "values" parameter properties of the last inheritor have priority
                "operation": "merge",
                "name": "DataGridActiveRowOpenAction",
                "parentName": "DataGrid",
                "propertyName": "activeRowActions",
                "values": {
                    "className": "Terrasoft.Button",
                    "style": Terrasoft.controls.ButtonEnums.style.BLUE,
                    // new caption
                    "caption": "Test",
                    // new tag that will call the custom method
                    "tag": "test"
                }
            },
        ]/**SCHEMA_DIFF*/
in the "methods" section, override the onActiveRowAction parent method(buttonTag, primaryColumnValue) .
onActiveRowAction: function(buttonTag, primaryColumnValue) {
                // calling the method implementation from the
                this.callParent(arguments)base schema;
                // adding the button custom tag that calls the custom method 
                switch (buttonTag) {
                    case "test":
                        this.testFunction(primaryColumnValue);
                        break;
                }
            },

and add the testFunction() method with new functionality

Show all comments

Hi Community,

Any idea how can I open a section in client code?

Like 0

Like

2 comments

You'll use PushHistoryState to navigate to a section in client code. The following will go to the Contacts section: 

this.sandbox.publish("PushHistoryState", {hash: "SectionModuleV2/ContactSectionV2"});

The "hash" parameter is what appears after the ViewModule.aspx# in the url. 

Ryan

Dear Fulgen,

You can achieve such task in two ways. The first one is described by Ryan. This is an elegant and easy way to manipulate navigation.

Other approach is to use window.location.assign method https://webplatform.github.io/docs/apis/location/assign/ using relative or full path to the page. This approach will save browser history.

Regards,

Anastasia

Show all comments

I would like to have multiple edit pages configured to display depending on what needs to be done with a record that is not necessarily dependent on section field or for use with multiple statuses. For example, having the same edit page used for modifying a page that may be active or obsolete, which is different than adding a new record. If I add multiple edit pages and no field is selected in the New Page dialog, then all of the pages are "Not used," which is not accurate.

Like 0

Like

1 comments

Please investigate the structure of the "add" button in the diff. 

http://prntscr.com/n3nu3n

http://prntscr.com/n3nuj4

http://prntscr.com/n3nuyr

There are attributes and methods that you can override in order to add the functionality that you need. 

Show all comments

Hi Community,

On Case Edit Page when saving a record, it is going back to the previous screen, how can we forced it to stay on the current edit page after saving the record.

Like 0

Like

3 comments

You need to override the save method on the edit page and set isSilent to true in the config. Add this code to the edit page:

save: function(config) {
  config = config || {};
  config.isSilent = true;
  this.callParent([config]);
}

Ryan

Ryan Farley,

Hi,

In cases After saving the record on edit page i want to open next case without going back previous screen.How can we this.

Dear Harish,

In order to open next case without going back to the section page please consider using the following code:

save : function(config){

                config = config || {};

                config.isSilent = true;

                this.callParent([config]);

                // get the primaryId of the next case

                var primaryId = "57286774-E71A-4530-BB60-B2E514FA535F";

                // go to another edit page

                var requestUrl = "CardModuleV2/CasePage/edit/" + primaryId;

                this.sandbox.publish("PushHistoryState", {

                    hash : requestUrl

                });

            }

Please find an example of using this code in the article by the link below:

https://academy.creatio.com/documents/technic-sdk/7-15/how-add-button-section

Best regards,

Norton

Show all comments

What section is Approver expecting passed in the Approval process element?  The documentation below is using Employee and User interchangeably. The Approver field will not accept Manager read from an Employee record using a Read data System action and errors when the manager's User Id read from the System administration object is passed.

[Approver] – specify the approver user. Approver can be a specific employee, manager of a specific employee, or any employee who is a member of a bpm’online organizational or functional role.
 
If you select “Employee”, specify bpm’online user who is the approver in the [Employee] field.
 
If you select “Employee's manager”, specify bpm’online user whose direct superior is the approver. Direct superior is specified in the [Manager] profile of the employee's record in the [Employees] section.
Terrasoft.Common.DbOperationException: The INSERT statement conflicted with the FOREIGN KEY constraint "FKep594q6vK4JwPEgwcbsZ9TIk". The conflict occurred in database "katerra", table "dbo.UsrKaterraContactRoles", column 'Id'.
The statement has been terminated. ---> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FKep594q6vK4JwPEgwcbsZ9TIk". The conflict occurred in database "katerra", table "dbo.UsrKaterraContactRoles", column 'Id'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Polly.Policy.<>c__DisplayClass119_0`1.<Execute>b__0(Context ctx, CancellationToken ct)
   at Polly.Policy.<>c__DisplayClass129_0`1.<ExecuteInternal>b__0(Context ctx, CancellationToken ct)
   at Polly.Policy.<>c__DisplayClass103_0.<NoOp>b__1(Context ctx, CancellationToken ct)
   at Polly.NoOp.NoOpEngine.Implementation[TResult](Func`3 action, Context context, CancellationToken cancellationToken)
   at Polly.Policy.<>c.<NoOp>b__103_0(Action`2 action, Context context, CancellationToken cancellationToken)
   at Polly.Policy.ExecuteInternal[TResult](Func`3 action, Context context, CancellationToken cancellationToken)
   at Polly.Policy.Execute[TResult](Func`3 action, Context context, CancellationToken cancellationToken)
   at Polly.Policy.Execute[TResult](Func`1 action)
   at Terrasoft.DB.MSSql.MSSqlExecutor.FailoverExecute[TResult](DbCommand command, Func`1 func)
   at Terrasoft.Core.DB.DBExecutor.ExecuteCommand[TResult](Func`2 commandExecutionCallback, String sqlText, QueryParameterCollection queryParameters, CancellationToken cancellationToken)
   at Terrasoft.Core.DB.DBExecutor.Execute(String sqlText, QueryParameterCollection queryParameters)
   at Terrasoft.Core.Entities.Entity.InsertToDB(Boolean skipLookupColumnValues, Boolean validateRequired)
   --- End of inner exception stack trace ---
   at Terrasoft.Core.Entities.Entity.InsertToDB(Boolean skipLookupColumnValues, Boolean validateRequired)
   at Terrasoft.Core.Entities.Entity.InternalSave(Boolean validateRequired, Boolean setColumnDefValue)
   at Terrasoft.Core.Entities.Entity.Save(Boolean validateRequired, Boolean setColumnDefValue)
   at Terrasoft.Core.Process.ProcessEngineImpl.AddProcessListener(Entity entity, Guid processElementUId, String conditionData, String changedColumns, EntityChangeType entityChangeType)
   at Terrasoft.Core.Process.Configuration.ApprovalUserTask.InternalExecute(ProcessExecutingContext context)
   at Terrasoft.Core.Process.ProcessActivity.Execute(ProcessExecutingContext context)

 

Like 0

Like

1 comments

Hello,



It seems that "Approver" is not a section, but a field in "employee" object. This fields should contain the Id of contact instead of id of the system administration object. 

In case you use script task and have difficulties with it, you may try to create a business process and use process elements like "read data" or "modify data" to perform some manipulations with data.



Basically, what I recommend to do is to trigger business process from the c# code. 

https://community.bpmonline.com/questions/calling-business-process-parameters-anonymous-web-service 



Best regards,

Alex

Show all comments

Hi,

I have gone through this doc

For a contact, once I try to click on FB button from 'Communication options' than nothing is happening and below errors are showing on browser console

I'm doing this testing on local dev system. If 'http' is causing problem than how to avoid this issue?

 

Any help will be highly appreciable.

 

Regards

Like 0

Like

1 comments

Dear Muhammad, 

The error says that the site needs to be switched to https, you can find the instruction how to set it up here: https://academy.bpmonline.com/documents/administration/7-13/switching-h…

However, the integration with Facebook may be working incorrectly now because Facebook closed the possibility to integrate with closing their API.

Best regards, 

Dennis 

 

Show all comments