Call external object from business process

Hi,

How I can call external object Page HTML from business process, If there’s a possibility who can I do it.

Thanks.

You should be able to do it using the “external page” type… Do you have an issue with this ?

You mean by your answer to create a HTML Page like this:

Please refer to this document to learn how to implement a custom UI page using an external object: https://docs.simplicite.io/documentation/01-core/externalobject-code-examples.md

Calling it from an activity workflow is another topic.

PS: make sure to prefer the responsive UI patterns for your external objects UI custom pages

The problem isn’t to create a HTML Page, is to call in Business process.

PS: HTML Page is done

External object :

namePerimetre.display = function(params) {
	var g = this.getGrant();
	this.setDecoration(false);
	var wp = new JQueryWebPage(params.getRoot(), this.getDisplay());
	wp.appendAjax();
	wp.appendJSIncludes(HTMLTool.bootstrapJS());
	wp.appendJSIncludes(HTMLTool.bootboxJS());
	wp.appendBootstrap(true);
	wp.append(HTMLTool.getResourceHTMLContent(this, "HTML"));
	return wp.toString();
};

HTML :

<!DOCTYPE html>
<html>
<head>
    <title>Simplicite custom web front-end demo</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
   
</head>
<body>
<!--<section class="container-fuild">
    <header>
    </header>
    
</section>-->
<section>
        <!--<h1>Entre your customer code : </h1>-->
          <div class="form-group">
    		<input type="text" class="form-control" id="codeCustomer" placeholder="Please entre your customer code">
		  </div>
</section>
</body>
</html>

I hope you’re understand my question.

Call External object from Business process

That was my initial question => do you have an issue integrating a working external page as an activity of your activity workflow ?

Your external page is not using the responsive UI single page component pattern, it is a standalone page that will display in an iframe in an unefficient “backward compatibility” mode.

I don’t know if you implemented this page as a standalone page for a good reason but if it is not the case you should really switch to the right modern responsive UI pattern.

I’m not sure I understood your answer correctly.

I need to implement a filed in business process like this :

By “filed” you mean a “custom form” ?

Business process :

Step 1:

Step 2:

Activity type = External page
Activity data = Page.Method = myPage (a method name)

then the method has to be implemented in the Process script

in java

public String myPage(Processus p, ActivityFile af, ObjectContextWeb ctx, Grant g) {
  return "hello world";
}

or in script

MyProcess.myPage = function(p,af,ctx,g) { ...
}

Thanks,

I would like to know if I have the possibility to write this code .

Script Rhino :

MyProcess.myPage = function(p,af,ctx,g) { 
	var m = "";
	m+="<section>";
	m+="<div class=\"form-group\">";
	m+="<div class=\"col-sm-2\">";
	m+="<label for=\"namePerimeter\">Name perimeter</label>";
	m+="</div>";
	m+="<div class=\"col-sm-10\">";
	m+="<input type=\"text\" class=\"form-control\" id=\"namePerimeter\" placeholder=\"Please entre your perimeter\">";
	m+="</div>";
	m+="</div>";
	m+="</section>";
	m+="<div id=\"footer\">&copy; Simplicit&eacute; Software</div>";
	return m;
}

I await your reply

Why don’t you simply display your object’s form ?

I don’t think I understood your answer right.
How, I can do it.

It seems you first activity is a “Select single” activity of some object (the empty fields in the list are strange though here but it is another topic…)

What do you want to do on your second activity ?

In Simplicité any solution is bound to a business requirement, if you ask us only “technical” questions without explaining your requirement chances are we won’t provide you the best answer… it is very difficult for us to guess what is your requirement hidden behind your questions.

Note I have made this topic public as we are discussing general stuff. Please use private categories only for confidential topics.

Le scénario que je souhaite réaliser est le suivant :

  • Choisir à partir d’une activité Select single une donnée, ensuite passer à l’étape suivante ( la deuxième activité ) avoir un champ de texte qui me permet de saisir le nom d’un périmètre, sachant que le nom périmètre est un attribut de la table Perimetre.

Process Business que je souhaite réaliser :

NB : nom périmetre,modalité de calcul, Fuseau horaire, engagement sont des attributs de “Perimetre”

Je ne comprends pas votre besoin métier

Pourquoi devez vous saisir le nom d’un périmètre si vous avez déjà choisi un record périmètre à l’étape précédente ?

S’agit il d’une mise à jour du champ nom du record précédement choisi ?
S’agit il d’une création d’un nouveau périmètre (peut être lié à celui précédement choisi) ?
Autre ?

C’est pas le nom perimetre ( erreur de frappe ), plutôt nom indicateur et la table c’est Indicateur.

NB : nom indicateur, modalité de calcul, Fuseau horaire, engagement sont des attributs de "Indicateur"

Donc, si je comprends bien, cette 2ème étape est une création d’un record de l’objet métier Indicateur, c’est bien ça ?

Y a-t-il un lien entre votre objet Périmètre et cet objet Indicateur ?

Note: le terme “table” est à éviter avec Simplicité car il est potentiellement ambigu => un objet métier n’est pas nécessairement une table et réciproquement. Dans Simplicité on gère des objets métier peu importe s’ils sont stockés dans une table ou non.

Ok @david c’est noté, oui il y a un lien ( 0,n ) entre Objet Perimetre et Incidateur